Dundas Data Visualization Support Site
Dundas Support Site Home  |  Contact Us  |  Dundas Data Visualization  
Contact Us via Email
Home

How can I specify the z-order of the series in the chart?

 

Q. How can I specify the z-order of the series in the chart?

A. The z-order is determined by the order of the series in the series collection.

The series doesn't have a property that you set to determine the z-order, but instead the z-order is determined by its position in the collection. If you have 3 series, for example, the last series to be added (the one in the bottom of the list) will be drawn on top of the others.

If there is a series that you want on top of the other series, the easiest time to do this is at design-time.

  • In Dundas Chart for .NET, right-click the Chart and choose Properties. In the Properties window, select and open the Series collection, and use the up and down arrows to re-order the series.

  • In Dundas Chart for Reporting Services, right-click the Chart and choose Properties. In the Data tab, select your series under the "Values" heading and use the up and down arrows to reorder them.

  • In Dundas Chart for SharePoint, use the Connect To Data wizard to define your series. The first series will be drawn first and on the bottom, and the last series will be drawn last on top of the others.

If your series doesn't exist at design time, you will need to use code to re-order the series. (E.g., if you added the series at run time, if a data-binding function created the series, or you use a "series grouping" or "group by" field.) The easiest way to do this using code is to just remove the series from the collection and add it again so that it becomes the last series to be added to the series collection.

[C#]
        Series topSeries = Chart1.Series["Series1"];
        Chart1.Series.Remove(topSeries);
        Chart1.Series.Add(topSeries);
[VB.NET]
        Dim topSeries As Series = Chart1.Series("Series1")
        Chart1.Series.Remove(topSeries)
        Chart1.Series.Add(topSeries)

Before

After

PoorExcellent