SeriesPointCollection.Swap(SeriesPoint, SeriesPoint) 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 |
---|---|---|
point1 | SeriesPoint | A SeriesPoint object which specifies the first series point to swap. If null, then a ArgumentNullException will be raised. If the specified series point doesn’t belong to the collection, then a ArgumentException will be raised. |
point2 | SeriesPoint | A SeriesPoint object which specifies the second series point to swap. If null, then a ArgumentNullException will be raised. If the specified series point doesn’t belong to the collection, then a ArgumentException will be raised. |
Remarks
Use the Swap method to quickly change the positions of the two specified series points within the series points collection. Note, that the order of the series items within the collection is useful, for instance, when drawing the chart’s data. It specifies the order in which series points are drawn when the ScaleType.Qualitative scale type is applied. First the first series points in the collection are painted, then the second, and so on. Hence, changing the position of the series points within the collection changes the order in which the series points are painted within a chart.
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Swap(SeriesPoint, SeriesPoint) method.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.