menu

ASP.NET MVC - EJ2

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

    Show / Hide Table of Contents

    Class ChartDataLabelSettings

    Inheritance
    System.Object
    Syncfusion.EJ2.EJTagHelper
    ChartDataLabelSettings
    MarkerSettingsDataLabelMarker
    Namespace: Syncfusion.EJ2.Charts
    Assembly: Syncfusion.EJ2.dll
    Syntax
    public class ChartDataLabelSettings : EJTagHelper

    Constructors

    ChartDataLabelSettings()

    Declaration
    public ChartDataLabelSettings()

    Properties

    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 Alignment Alignment { get; set; }
    Property Value
    Type Description
    Alignment

    The default value is Syncfusion.EJ2.Charts.Alignment.Center

    Angle

    Specifies the rotation angle of the data label.

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

    The default value is 0

    Border

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

    Declaration
    public ChartBorder Border { get; set; }
    Property Value
    Type Description
    ChartBorder

    The default value is null

    ContentTemplate

    To get or set value for ContentTemplate.

    Declaration
    public MvcTemplate<object> ContentTemplate { get; set; }
    Property Value
    Type
    Syncfusion.EJ2.MvcTemplate<System.Object>

    EnableRotation

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

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

    The default value is false

    Fill

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

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

    The default value is "transparent"

    Font

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

    Declaration
    public ChartFont Font { get; set; }
    Property Value
    Type Description
    ChartFont

    The default value is null

    Format

    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 string Format { get; set; }
    Property Value
    Type Description
    System.String

    The default value is null

    LabelIntersectAction

    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 DataLabelIntersectAction LabelIntersectAction { get; set; }
    Property Value
    Type Description
    DataLabelIntersectAction

    The default value is DataLabelIntersectAction.Hide

    Margin

    Configures the margin for the data label.

    Declaration
    public ChartMargin Margin { get; set; }
    Property Value
    Type Description
    ChartMargin

    The default value is null

    Name

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

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

    The default value is null

    Opacity

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

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

    The default value is 1

    Position

    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 LabelPosition Position { get; set; }
    Property Value
    Type Description
    LabelPosition

    The default value is LabelPosition.Auto

    Rx

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

    Ry

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

    ShowZero

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

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

    The default value is true

    Template

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

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

    The default value is null

    Visible

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

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

    The default value is false

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