menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class ChartDataLabel - Blazor API Reference | Syncfusion

    Show / Hide Table of Contents

    Class ChartDataLabel

    Provides options to customize the data label for the series.

    Inheritance
    System.Object
    ChartSubComponent
    ChartDataLabel
    Inherited Members
    ChartSubComponent.BuildRenderTree(RenderTreeBuilder)
    ChartSubComponent.ChildContent
    ChartSubComponent.Dispose(Boolean)
    Namespace: Syncfusion.Blazor.Charts
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class ChartDataLabel : ChartSubComponent, IChartElement, ISubcomponentTracker

    Constructors

    ChartDataLabel()

    Declaration
    public ChartDataLabel()

    Properties

    Alignment

    Gets or sets the alignment for the data labels.

    Declaration
    public Alignment Alignment { get; set; }
    Property Value
    Type Description
    Alignment

    An enumeration of type Alignment that defines the alignment of the data label. The default value is Center.

    Remarks

    This property specifies how data labels are aligned with respect to the data points.

    Angle

    Gets or sets the rotation angle for the data label.

    Declaration
    public double Angle { get; set; }
    Property Value
    Type Description
    System.Double

    A double representing the angle in degrees at which the data label is rotated. The default value is 0.

    Remarks

    This property is used to rotate the data label to a specified angle.

    Border

    Gets or sets the options to customize the border of the data label.

    Declaration
    public ChartDataLabelBorder Border { get; set; }
    Property Value
    Type
    ChartDataLabelBorder

    EnableRotation

    Gets or sets a value indicating whether rotation is enabled for the data label.

    Declaration
    public bool EnableRotation { get; set; }
    Property Value
    Type Description
    System.Boolean

    A boolean indicating if the rotation is enabled. The default value is false.

    Remarks

    When set to true, data labels will be rotated based on the specified angle.

    Fill

    Gets or sets the fill color of the datalabel.

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

    A string indicating the fill color of the data label. The default value is transparent.

    Remarks

    The fill color is used to set the background color of the data label.

    Font

    Gets or sets the options to customize the text style of the data label.

    Declaration
    public ChartDataLabelFont Font { get; set; }
    Property Value
    Type
    ChartDataLabelFont

    Format

    Gets or sets the format for the data label text.

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

    A string specifying the format of the data label. The default value is null.

    Remarks

    This property supports global string formats like 'C', 'P', 'N1' and will also accept custom formats like '{value}°C'.

    LabelIntersectAction

    Gets or sets the action for data label intersection.

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

    A string representing the action to be taken when data labels intersect.

    Remarks

    This property determines how labels are handled when they overlap on the chart.

    Margin

    Gets or sets the options to customize the margin for the data label.

    Declaration
    public ChartDataLabelMargin Margin { get; set; }
    Property Value
    Type
    ChartDataLabelMargin

    Name

    Gets or sets the name used for data label mapping in the series.

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

    A string representing the mapping name of the data label.

    Remarks

    This property is used to map a specific data field to the data label.

    Opacity

    Gets or sets the opacity of the datalabel.

    Declaration
    public double Opacity { get; set; }
    Property Value
    Type Description
    System.Double

    A double representing the opacity level of the data label. Possible values range from 0 to 1. The default value is 1.

    Remarks

    This property specifies the transparency level of the data label background.

    Position

    Gets or sets the position of the data label.

    Declaration
    public LabelPosition Position { get; set; }
    Property Value
    Type Description
    LabelPosition

    An enumeration of type LabelPosition that defines the position of the data label. The default value is Auto.

    Remarks

    This property determines the positioning of the data label relative to the data point.

    Rx

    Gets or sets the horizontal radius of the rounded corners of the data label.

    Declaration
    public double Rx { get; set; }
    Property Value
    Type Description
    System.Double

    A double value representing the horizontal width of the rounded corner. The default value is 5.

    Remarks

    This property affects the appearance of the corners of the data label's background.

    Ry

    Gets or sets the vertical radius of the rounded corners of the data label.

    Declaration
    public double Ry { get; set; }
    Property Value
    Type Description
    System.Double

    A double value representing the vertical width of the rounded corner. The default value is 5.

    Remarks

    This property affects the appearance of the corners of the data label's background.

    Template

    Gets or sets the custom HTML element used instead of the standard data label.

    Declaration
    public RenderFragment<ChartDataPointInfo> Template { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.RenderFragment<ChartDataPointInfo>

    A Microsoft.AspNetCore.Components.RenderFragment<> representing the custom template for data labels.

    Remarks

    Use this property to define a custom template for rendering data labels.

    Visible

    Gets or sets a value indicating whether the data label is visible.

    Declaration
    public bool Visible { get; set; }
    Property Value
    Type Description
    System.Boolean

    A boolean indicating the visibility of the data label. The default value is false.

    Remarks

    Setting this property to true makes the data label visible on the chart series.

    Methods

    OnInitialized()

    Declaration
    protected override void OnInitialized()

    OnParametersSet()

    Declaration
    protected override void OnParametersSet()
    Overrides
    ChartSubComponent.OnParametersSet()
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved