alexa
menu

Blazor Toolkit

    Show / Hide Table of Contents

    Class ChartSorting

    Configures the sorting option for the chart.

    Inheritance
    System.Object
    SfBaseComponent
    ChartSubComponent
    ChartSorting
    Implements
    System.IAsyncDisposable
    Inherited Members
    SfBaseComponent.DisposeAsync()
    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:

    • Ascending: Sorts the chart data from smallest value to largest (e.g., A to Z).
    • Descending: Sorts the chart data from largest value to smallest (e.g., Z to A).
    The default value is Syncfusion.Blazor.Toolkit.Data.ListSortDirection.Ascending.
    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 X, Y, High, Low, Open, Close, or Size fields in the chart's data source. The default value is null.

    Remarks

    This determines the field by which the chart data is sorted.

    Examples
    <ChartSorting PropertyName="X" Direction="ListSortDirection.Ascending" />

    Implements

    System.IAsyncDisposable
    Back to top Generated by DocFX
    Copyright © 2001 - 2026 Syncfusion Inc. All Rights Reserved