SeriesCollection.Swap(Series, Series) Method
Swaps the two specified series within the series collection.
Namespace: DevExpress.XtraCharts
Assembly: DevExpress.XtraCharts.v24.1.dll
NuGet Package: DevExpress.Charts
Declaration
Parameters
Name | Type | Description |
---|---|---|
series1 | Series | A Series object which specifies the first series to swap. If null, then the ArgumentNullException will be raised. If the specified series doesn’t belong to the collection, then the ArgumentException will be raised. |
series2 | Series | A Series object which specifies the second series to swap. If null, then the ArgumentNullException will be raised. If the specified series doesn’t belong to the collection, then the ArgumentException will be raised. |
Remarks
Use the Swap method to quickly swap the position of the two specified series within the series collection. Note that the order of the series items within the collection is useful, for instance, when drawing chart data. It specifies the order in which series points are drawn. First, all the series points of the first series are painted, then those of the second, etc. Hence, changing the positions of the series within the collection changes the order in which the series is painted within a chart.
Note
It’s impossible to swap a series that was created using a series template with a series that was created without a series template.