alexa
menu

Blazor Toolkit

    Show / Hide Table of Contents

    Class ChartAxisLabelInfo

    Defines the axis label template point information.

    Inheritance
    System.Object
    ChartAxisLabelInfo
    Namespace: Syncfusion.Blazor.Toolkit.Charts
    Assembly: Syncfusion.Blazor.Toolkit.dll
    Syntax
    public class ChartAxisLabelInfo : Object

    Constructors

    ChartAxisLabelInfo()

    Initializes a new instance of the ChartAxisLabelInfo class.

    Declaration
    public ChartAxisLabelInfo()
    Remarks

    The parameterless constructor is used for JSON deserialization and default initialization.

    ChartAxisLabelInfo(String, DateTime)

    Initializes a new instance of the ChartAxisLabelInfo class with text and date.

    Declaration
    public ChartAxisLabelInfo(string text, DateTime date)
    Parameters
    Type Name Description
    System.String text

    The label text.

    System.DateTime date

    The DateTime value for the label.

    Properties

    DateTimeLabel

    Gets the DateTime object for the current axis label in the DateTime axis, which can be used for display in the axis label template.

    Declaration
    public DateTime DateTimeLabel { get; set; }
    Property Value
    Type Description
    System.DateTime

    A DateTime value representing the text to be displayed in the DateTime axis labels.

    Remarks

    This property can be used to display date and time details in axis label templates for DateTime axes.

    Examples
     
    
    <SfChart> 
        <ChartPrimaryXAxis> 
            <LabelTemplate> 
                @{ 
                    var data = context as ChartAxisLabelInfo; 
                } 
                <div>@data.DateTimeValue.Month.ToString() </div> 
            </LabelTemplate> 
        </ChartPrimaryXAxis> 
    </SfChart> 

    Text

    Gets the text for each label in the axis, which can be used to display in the axis label template.

    Declaration
    public string Text { get; set; }
    Property Value
    Type Description
    System.String

    A string value representing text to be displayed in the axis labels.

    Remarks

    This text can be used to display in the axis label templates for axis types such as category, numeric, and logarithmic.

    Examples
     
    
    <SfChart> 
        <ChartPrimaryXAxis> 
            <LabelTemplate> 
                @{ 
                    var data = context as ChartAxisLabelInfo; 
                } 
                <div>@data.Text</div> 
            </LabelTemplate> 
        </ChartPrimaryXAxis> 
    </SfChart> 
    Back to top Generated by DocFX
    Copyright © 2001 - 2026 Syncfusion Inc. All Rights Reserved