Class ChartSorting
Configures the sorting option for the chart.
Implements
Inherited Members
Namespace: Syncfusion.Blazor.Toolkit.Charts
Assembly: Syncfusion.Blazor.Toolkit.dll
Syntax
public class ChartSorting : ChartSubComponent, IAsyncDisposable, ISubcomponentTracker
Remarks
Use this component to sort the chart's bound data source by a specific property and direction before rendering the series. Runtime changes call Syncfusion.Blazor.Toolkit.Charts.SfChart.RefreshChartAsync when the chart is already rendered.
Examples
This example shows how to sort a chart by the "Y" property in ascending order.
<SfChart @ref="Chart" DataSource="Data">
<ChartSorting PropertyName="Y" Direction="ListSortDirection.Ascending" />
...
</SfChart>
Constructors
ChartSorting()
Declaration
public ChartSorting()
Properties
Direction
Gets or sets the sorting direction for the chart data.
Declaration
public ListSortDirection Direction { get; set; }
Property Value
| Type | Description |
|---|---|
| Syncfusion.Blazor.Toolkit.Data.ListSortDirection | A Syncfusion.Blazor.Toolkit.Data.ListSortDirection that specifies the sort order for the chart data. The possible values are:
|
Remarks
This property defines the sorting behavior applied to the chart's data source.
Examples
<ChartSorting PropertyName="X" Direction="ListSortDirection.Descending" />
PropertyName
Gets or sets the property name used as the sorting criterion.
Declaration
public string PropertyName { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String | A System.String specifying the property name for sorting, such as the |
Remarks
This determines the field by which the chart data is sorted.
Examples
<ChartSorting PropertyName="X" Direction="ListSortDirection.Ascending" />