corelibraries-devexpress-dot-xtracharts-dot-seriesbase-7db3f28e.md
Gets or sets a value that specifies the values of the data points that the series should be sorted by.
Namespace : DevExpress.XtraCharts
Assembly : DevExpress.XtraCharts.v25.2.dll
NuGet Package : DevExpress.Charts
[XtraChartsLocalizableCategory(XtraChartsCategory.Behavior)]
public SeriesPointKey SeriesPointsSortingKey { get; set; }
<XtraChartsLocalizableCategory(XtraChartsCategory.Behavior)>
Public Property SeriesPointsSortingKey As SeriesPointKey
| Type | Description |
|---|---|
| SeriesPointKey |
A SeriesPointKey enumeration value.
|
Available values:
| Name | Description |
|---|---|
| Argument |
Specifies that sorting is performed by the argument values of a series’ data points.
| | Value_1 |
Specifies that series points are sorted based on the first data value within the SeriesPoint.Values array of a series’s data points. For financial data, Value_1 indicates the Low value. For BoxPlot series, it indicates the Min value.
| | Value_2 |
Specifies that series points are sorted based on the second data value within the SeriesPoint.Values array of a series’s data points. For financial data, Value_2 indicates the High value. For BoxPlot series, it indicates the Quartile1 value.
| | Value_3 |
Specifies that series points are sorted based on the third data value within the SeriesPoint.Values array of a series’s data points. For financial data, Value_3 indicates the Open value. For BoxPlot series, it indicates the Median value.
| | Value_4 |
Specifies that series points are sorted based on the fourth data value within the SeriesPoint.Values array of a series’s data points. For financial data, Value_4 indicates the Close value. For BoxPlot series, it indicates the Quartile3 value.
| | Value_5 |
Specifies that series points are sorted based on the fifth data value within the SeriesPoint.Values array of a series’s data points. For BoxPlot series, it indicates the Max value.
| | Value_6 |
Specifies that series points are sorted based on the sixth data value within the SeriesPoint.Values array of a series’s data points. For BoxPlot series, it indicates the Mean value.
|
Series points can be sorted based upon either their arguments or data values. Use the SeriesPointsSortingKey property to specify which values of the series’ data points should be used to sort the series data.
The sort order can be specified via the SeriesBase.SeriesPointsSorting property.
Note
Since, for some series view types, multiple values for each data point are required, there are four value modes for the SeriesBase.SeriesPointsSortingKey property. So, at runtime, to sort by values points of a series whose view type supports only a single value, choose the SeriesPointKey.Value_1 setting.
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
}
}
Imports DevExpress.XtraCharts
Imports System
Imports System.Windows.Forms
Namespace SeriesPointsSorting
Partial Public Class Form1
Inherits Form
Public Sub New()
InitializeComponent()
End Sub
#Region "#SeriesPointSorting"
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load
Me.gSPTableAdapter.Fill(Me.gspDataSet.GSP)
Dim seriesTemplate As SeriesBase = chart.SeriesTemplate
seriesTemplate.SeriesPointsSorting = SortingMode.Ascending
seriesTemplate.SeriesPointsSortingKey = SeriesPointKey.Value_1
End Sub
#End Region ' #SeriesPointSorting
End Class
End Namespace
The following code snippets (auto-collected from DevExpress Examples) contain references to the SeriesPointsSortingKey property.
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.
winforms-visualize-data-grid-rows-in-a-chart/CS/ControlRowSourceSample/MainForm.cs#L32
seriesTemplate.SeriesPointsSorting = SortingMode.Descending;
seriesTemplate.SeriesPointsSortingKey = SeriesPointKey.Value_1;
seriesTemplate.SummaryFunction = "SUM([Revenue])";
winforms-visualize-data-grid-rows-in-a-chart/VB/ControlRowSourceSample/MainForm.vb#L30
seriesTemplate.SeriesPointsSorting = SortingMode.Descending
seriesTemplate.SeriesPointsSortingKey = SeriesPointKey.Value_1
seriesTemplate.SummaryFunction = "SUM([Revenue])"
winforms-chart-create-a-doughnut-chart/VB/Series_DoughnutChart/Form1.vb#L34
series1.SeriesPointsSorting = SortingMode.Ascending
series1.SeriesPointsSortingKey = SeriesPointKey.Argument
' Specify the behavior of series labels.
See Also