SeriesBase.SeriesPointsSorting Property

Gets or sets the sort order of the series’ points.

Namespace: DevExpress.XtraCharts

Assembly: DevExpress.XtraCharts.v21.1.dll

Declaration

[XtraChartsLocalizableCategory(XtraChartsCategory.Behavior)]
public SortingMode SeriesPointsSorting { get; set; }

Property Value

Type Description
SortingMode

A SortingMode enumeration value.

Available values:

Name Description
None

The values are not sorted.

Ascending

The values are sorted in ascending order.

Descending

The values are sorted in descending order.

Remarks

The Chart Control can sort series points based on their arguments or data values, specified in the SeriesBase.SeriesPointsSortingKey property. Use the SeriesPointsSorting property to choose the sort mode for data points.

When there are multiple series with the same arguments in the chart’s collection, and a sort order is applied to one of these series, points are sorted within all series.

Note

If series have different point arguments, the Chart Control sorts points within a single series only. Use the QualitativeScaleComparer to sort all series in this case.

The following images demonstrate the three modes available for the SeriesPointsSorting property, with the series points sorted by their values.

SeriesPointsSorting = None

SeriesPointsSorting = Ascending

SeriesPointsSortingKey = Value_1

SeriesPointsSorting = Descending

SeriesPointsSortingKey = Value_1

SeriesPointSorting_none

SeriesPointSorting_ascend

SeriesPointSorting_descend

For more information, refer to the following help topic: Sorting Data.

Example

The following properties allow you to sort series points within a series.

Property Description
SeriesBase.SeriesPointsSortingKey Specifies the point sort order.
SeriesBase.SeriesPointsSorting Specifies the value by which series points should be sorted.
using DevExpress.XtraCharts;
using System;
using System.Windows.Forms;

namespace SeriesPointsSorting {
    public partial class Form1 : Form {
        public Form1() {
            InitializeComponent();
        }

        #region #SeriesPointSorting
        private void Form1_Load(object sender, EventArgs e) {
            this.gSPTableAdapter.Fill(this.gspDataSet.GSP);

            SeriesBase seriesTemplate = chart.SeriesTemplate;
            seriesTemplate.SeriesPointsSorting = SortingMode.Ascending;
            seriesTemplate.SeriesPointsSortingKey = SeriesPointKey.Value_1;
        }
        #endregion #SeriesPointSorting
    }
}
See Also