• Bootstrap v5
  • Bootstrap v5 Dark
  • Tailwind CSS
  • Tailwind CSS Dark
  • Material
  • Bootstrap v4
  • Fabric
  • Fabric Dark
  • High Contrast
Theme Selection
Mode Selection
*Translated by Google Translator.

Example of Sorting in ASP.NET MVC Chart Control

This sample visualizes sales for vehicle range for different zone with default stacked column series in chart. Legend in the sample shows the information about those series.

Sort By:

In this example, you can see how to sort the series data in chart. To sort the data points of the series, use the sort method. This method determines whether the series data points should be sorted by their arguments or values.

Tooltip is enabled in this example. To see the tooltip in action, hover a point or tap a point in touch enabled devices.

Injecting Module

Chart component features are segregated into individual feature-wise modules. To use stacking column series, we need to inject StackingColumnSeries module using the Chart.Inject(StackingColumnSeries) method.

More information on the stacking column series can be found in this documentation section.