alexa
menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Search Results for

    Show / Hide Table of Contents

    Class ChartSorting

    Configures the sorting option for the chart.

    Inheritance
    object
    ComponentBase
    OwningComponentBase
    SfOwningComponentBase
    ChartSubComponent
    ChartSorting
    Implements
    IComponent
    IHandleEvent
    IHandleAfterRender
    IDisposable
    Inherited Members
    ComponentBase.Assets
    ComponentBase.AssignedRenderMode
    ComponentBase.BuildRenderTree(RenderTreeBuilder)
    ComponentBase.DispatchExceptionAsync(Exception)
    ComponentBase.InvokeAsync(Action)
    ComponentBase.InvokeAsync(Func<Task>)
    ComponentBase.OnAfterRender(bool)
    ComponentBase.OnAfterRenderAsync(bool)
    ComponentBase.OnInitialized()
    ComponentBase.OnInitializedAsync()
    ComponentBase.OnParametersSet()
    ComponentBase.OnParametersSetAsync()
    ComponentBase.RendererInfo
    ComponentBase.SetParametersAsync(ParameterView)
    ComponentBase.ShouldRender()
    ComponentBase.StateHasChanged()
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    OwningComponentBase.Dispose(bool)
    OwningComponentBase.IsDisposed
    OwningComponentBase.ScopedServices
    Namespace: Syncfusion.Blazor.Charts
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class ChartSorting : ChartSubComponent, IComponent, IHandleEvent, IHandleAfterRender, IDisposable
    Examples

    This example shows how to sort a chart by the "Y" property in asscending order.

    <SfChart @ref=”Chart” DataSource=”Data”>
    <ChartSorting PropertyName ="Y" Direction ="SortDirection.Descending"/> 
    …  
    </SfChart>

    Constructors

    ChartSorting()

    Declaration
    public ChartSorting()

    Properties

    Direction

    Get and set the sorting direction for the chart data. The available direction are,

    • Ascending Sort from smallest to largest. For example, from A to Z.
    • Descending Sort from largest to smallest. For example, from Z to A.
    Declaration
    [Parameter]
    public ListSortDirection Direction { get; set; }
    Property Value
    Type Description
    ListSortDirection

    An ListSortDirection that specifies the sort order for the chart data. The possible values are:

    • Ascending: Sorts the chart data from smallest value to largest.
    • Descending: Sorts the chart data from largest value to smallest.

    The default value is Ascending.
    Remarks

    This property is essential for defining the sorting behavior of the chart data.

    Examples
    // This example demonstrates how to sort the chart data in descending order based on the X axis values.
    <SfChart>
        <ChartSorting PropertyName="X" Direction="ListSortDirection.Descending"></ChartSorting>
        <ChartPrimaryXAxis ValueType="Syncfusion.Blazor.Charts.ValueType.Category" />
        <ChartSeriesCollection>
            <ChartSeries DataSource="@SalesReports" XName="X" YName="YValue" Type="ChartSeriesType.Column"></ChartSeries>
        </ChartSeriesCollection>
    </SfChart>

    PropertyName

    Gets or sets the property name being used as the sorting criterion.

    Declaration
    [Parameter]
    public string PropertyName { get; set; }
    Property Value
    Type Description
    string

    A string specifying the property name for sorting, such as x, y, high, low, open, close, or size fields of the chart data source. The default value is null.

    Remarks

    This property determines the field by which the chart data should be sorted.

    Examples
    // This example demonstrates how to sort the chart data in ascending order based on the X axis values.
    <SfChart>
        <ChartSorting PropertyName="X" Direction="ListSortDirection.Descending"></ChartSorting>
        <ChartPrimaryXAxis ValueType="Syncfusion.Blazor.Charts.ValueType.Category" />
        <ChartSeriesCollection>
            <ChartSeries DataSource="@SalesReports" XName="X" YName="YValue" Type="ChartSeriesType.Column"></ChartSeries>
        </ChartSeriesCollection>
    </SfChart>

    Implements

    IComponent
    IHandleEvent
    IHandleAfterRender
    IDisposable
    In this article
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved