Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Expand]WinForms Controls
[Collapse]ASP.NET Controls and MVC Extensions
 [Expand]Prerequisites
 [Expand]What's Installed
 [Expand]Common Concepts
 [Collapse]ASP.NET WebForms Controls
  [Expand]Reporting
  [Collapse]Chart Control
   [Expand]Product Information
   [Expand]Getting Started
   [Expand]Fundamentals
   [Collapse]Concepts
    [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]Miscellaneous
    [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]Examples
  [Expand]Grid View
  [Expand]Card View
  [Expand]Vertical Grid
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Image and Data Browsing
  [Expand]Docking and Popups
  [Expand]Site Navigation and Layout
  [Expand]File Management
  [Expand]Multi-Use Site Controls
  [Expand]Scheduler
  [Expand]HTML Editor
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Gauges
  [Expand]Data Editors
  [Expand]Spell Checker
  [Expand]Query Builder
 [Expand]ASP.NET MVC Extensions
 [Expand]Localization
 [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]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[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

How would you rate this topic?​​​​​​​