[Expand]General Information
[Expand]WinForms Controls
[Collapse]ASP.NET Controls and MVC Extensions
 [Expand]What's Installed
 [Expand]Common Concepts
 [Collapse]ASP.NET WebForms Controls
   Getting Started
  [Expand]Grid View
  [Expand]Tree List
  [Expand]Card View
  [Collapse]Chart Control
   [Expand]Product Information
   [Expand]Getting Started
    [Collapse]Creating Charts
     [Expand]2D Chart Types
     [Expand]3D Chart Types
     [Expand]Providing Data
     [Collapse]Data Representation
       Filtering Data
       Sorting Data
       Calculating Summaries
       Using The Top-N Feature
       Data Aggregation
       Workday and Holiday Exclusion
       Empty Points Representation
     [Expand]Appearance Customization
    [Expand]Chart Elements
    [Expand]End-User Interaction
     Supported Browsers
     Adding a Web Chart
     Handling Client-side Scripts
     Medium Trust Support
     Web Farm and Web Gardens Support
   [Expand]Design-Time Features
   [Expand]Visual Elements
  [Expand]Pivot Grid
  [Expand]Rich Text Editor
  [Expand]Site Navigation and Layout
  [Expand]HTML Editor
  [Expand]Vertical Grid
  [Expand]Data Editors
  [Expand]Docking and Popups
  [Expand]File Management
  [Expand]Data and Image Navigation
  [Expand]Multi-Use Site Controls
  [Expand]Spell Checker
  [Expand]Query Builder
 [Expand]ASP.NET MVC Extensions
 [Expand]Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Report and Dashboard Server
[Expand]eXpressApp Framework
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Sorting Data

This document describes how to sort auto-created series or series points in an ascending or descending order, and in the case of series points, to choose whether sorting should be performed by the series points' values or arguments. To learn more about a data point, its argument and value, refer to Charting Basics.

These sorting capabilities are detailed in the following sections:

Expanded Sorting Series

For auto-created series, its possible to define the order in which automatically generated series objects are sorted within the chart control, based upon the series names. Note that the names of the dynamically created series are taken from a data field specified by the WebChartControl.SeriesDataMember property.

So, to toggle between ascending and descending sort order of auto-created series, use the WebChartControl.SeriesSorting property. The following images demonstrate this property in action.

SeriesSorting = None

SeriesSorting = Ascending

SeriesSorting = Descending

Note that the defined sorting affects the order of series within both a chart's diagram, and its legend.

As for series that are manually added to a chart's series collection (via the WebChartControl.Series property), it's only possible to sort them at runtime, by managing their order within the collection.

Expanded Sorting Series Points

To sort data points of a series, use the SeriesBase.SeriesPointsSorting property. The SeriesBase.SeriesPointsSortingKey property determines whether series points should be sorted by their arguments or by values.

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

SeriesPointsSorting = None
SeriesPointsSortingKey = Value

SeriesPointsSorting = Ascending
SeriesPointsSortingKey = Value

SeriesPointsSorting = Descending
SeriesPointsSortingKey = Value

Expanded See Also

Is this topic helpful?​​​​​​​