menu

ASP.NET MVC - EJ2

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class ChartDataLabelSettingsBuilder - ASP.NETMVC-EJ2 API Reference | Syncfusion

    Show / Hide Table of Contents

    Class ChartDataLabelSettingsBuilder

    Inheritance
    System.Object
    Syncfusion.EJ2.ControlBuilder
    ChartDataLabelSettingsBuilder
    Namespace: Syncfusion.EJ2.Charts
    Assembly: Syncfusion.EJ2.dll
    Syntax
    public class ChartDataLabelSettingsBuilder : ControlBuilder

    Constructors

    ChartDataLabelSettingsBuilder()

    Declaration
    public ChartDataLabelSettingsBuilder()

    ChartDataLabelSettingsBuilder(ChartDataLabelSettings)

    Declaration
    public ChartDataLabelSettingsBuilder(ChartDataLabelSettings model)
    Parameters
    Type Name Description
    ChartDataLabelSettings model

    Methods

    Alignment(Alignment)

    Specifies the alignment of the data label relative to the data point. The available options are: Near: Positions the label to the left of the data point. Center: Positions the label in the center of the data point. Far: Positions the label to the right of the data point.

    Declaration
    public ChartDataLabelSettingsBuilder Alignment(Alignment value)
    Parameters
    Type Name Description
    Alignment value
    Returns
    Type
    ChartDataLabelSettingsBuilder

    Angle(Double)

    Specifies the rotation angle of the data label.

    Declaration
    public ChartDataLabelSettingsBuilder Angle(double value)
    Parameters
    Type Name Description
    System.Double value
    Returns
    Type
    ChartDataLabelSettingsBuilder

    Border(ChartBorder)

    Configures the appearance of the border lines with options for width and color properties.

    Declaration
    public ChartDataLabelSettingsBuilder Border(ChartBorder value)
    Parameters
    Type Name Description
    ChartBorder value
    Returns
    Type
    ChartDataLabelSettingsBuilder

    Border(Action<ChartBorderBuilder>)

    Declaration
    public ChartDataLabelSettingsBuilder Border(Action<ChartBorderBuilder> border)
    Parameters
    Type Name Description
    System.Action<ChartBorderBuilder> border
    Returns
    Type
    ChartDataLabelSettingsBuilder

    EnableRotation(Boolean)

    If set to true, the data label will be rotated according to the specified angle.

    Declaration
    public ChartDataLabelSettingsBuilder EnableRotation(bool value)
    Parameters
    Type Name Description
    System.Boolean value
    Returns
    Type
    ChartDataLabelSettingsBuilder

    Fill(String)

    The background color of the data label accepts hex and rgba values as valid CSS color strings.

    Declaration
    public ChartDataLabelSettingsBuilder Fill(string value)
    Parameters
    Type Name Description
    System.String value
    Returns
    Type
    ChartDataLabelSettingsBuilder

    Font(ChartFont)

    Customizes the appearance of the data label text with options for font size, color, style, weight, and family.

    Declaration
    public ChartDataLabelSettingsBuilder Font(ChartFont value)
    Parameters
    Type Name Description
    ChartFont value
    Returns
    Type
    ChartDataLabelSettingsBuilder

    Font(Action<ChartFontBuilder>)

    Declaration
    public ChartDataLabelSettingsBuilder Font(Action<ChartFontBuilder> font)
    Parameters
    Type Name Description
    System.Action<ChartFontBuilder> font
    Returns
    Type
    ChartDataLabelSettingsBuilder

    Format(String)

    Used to format the data label, accepting global string formats like C, n1, P, etc. It also supports placeholders, such as {value}°C, where {value} represent the point data label (e.g., 20°C).

    Declaration
    public ChartDataLabelSettingsBuilder Format(string value)
    Parameters
    Type Name Description
    System.String value
    Returns
    Type
    ChartDataLabelSettingsBuilder

    LabelIntersectAction(DataLabelIntersectAction)

    Specifies the action to handle overlapping data labels. Available options include: None - All data labels are displayed, even if they overlap. Hide - Overlapping data labels are hidden to avoid clutter. Rotate90 - Data labels are rotated 90 degrees to avoid overlap and improve readability.

    Declaration
    public ChartDataLabelSettingsBuilder LabelIntersectAction(DataLabelIntersectAction value)
    Parameters
    Type Name Description
    DataLabelIntersectAction value
    Returns
    Type
    ChartDataLabelSettingsBuilder

    Margin(ChartMargin)

    Configures the margin for the data label.

    Declaration
    public ChartDataLabelSettingsBuilder Margin(ChartMargin value)
    Parameters
    Type Name Description
    ChartMargin value
    Returns
    Type
    ChartDataLabelSettingsBuilder

    Margin(Action<ChartMarginBuilder>)

    Declaration
    public ChartDataLabelSettingsBuilder Margin(Action<ChartMarginBuilder> margin)
    Parameters
    Type Name Description
    System.Action<ChartMarginBuilder> margin
    Returns
    Type
    ChartDataLabelSettingsBuilder

    Name(String)

    Specifies the data source field that contains the data label value.

    Declaration
    public ChartDataLabelSettingsBuilder Name(string value)
    Parameters
    Type Name Description
    System.String value
    Returns
    Type
    ChartDataLabelSettingsBuilder

    Opacity(Double)

    Specifies the opacity level for the data label background, which controls its transparency.

    Declaration
    public ChartDataLabelSettingsBuilder Opacity(double value)
    Parameters
    Type Name Description
    System.Double value
    Returns
    Type
    ChartDataLabelSettingsBuilder

    Position(LabelPosition)

    Specifies the position of the data label relative to the data point. The available options are: Outer: Positions the label outside the point. Top: Positions the label on top of the point. Bottom: Positions the label at the bottom of the point. Middle: Positions the label in the middle of the point. Auto: Automatically selects the best position for the label based on the series and data point.

    Declaration
    public ChartDataLabelSettingsBuilder Position(LabelPosition value)
    Parameters
    Type Name Description
    LabelPosition value
    Returns
    Type
    ChartDataLabelSettingsBuilder

    Rx(Double)

    Specifies the X-axis rounded corner radius for the data label.

    Note that border values must not be null for this feature to work.

    Declaration
    public ChartDataLabelSettingsBuilder Rx(double value)
    Parameters
    Type Name Description
    System.Double value
    Returns
    Type
    ChartDataLabelSettingsBuilder

    Ry(Double)

    Specifies the Y-axis rounded corner radius for the data label.

    Note that border values must not be null for this feature to work.

    Declaration
    public ChartDataLabelSettingsBuilder Ry(double value)
    Parameters
    Type Name Description
    System.Double value
    Returns
    Type
    ChartDataLabelSettingsBuilder

    ShowZero(Boolean)

    If set to true, data labels for zero values in the series are render.

    Declaration
    public ChartDataLabelSettingsBuilder ShowZero(bool value)
    Parameters
    Type Name Description
    System.Boolean value
    Returns
    Type
    ChartDataLabelSettingsBuilder

    Template(String)

    Custom template for the data label. Use ${point.x} and ${point.y} as placeholders to display the corresponding data point values.

    Declaration
    public ChartDataLabelSettingsBuilder Template(string value)
    Parameters
    Type Name Description
    System.String value
    Returns
    Type
    ChartDataLabelSettingsBuilder

    Visible(Boolean)

    If set to true, data labels for the series are render. By default, it is set to false.

    Declaration
    public ChartDataLabelSettingsBuilder Visible(bool value)
    Parameters
    Type Name Description
    System.Boolean value
    Returns
    Type
    ChartDataLabelSettingsBuilder
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved