Class ChartDataLabelSettingsBuilder
Inheritance
System.Object
Syncfusion.EJ2.ControlBuilder
ChartDataLabelSettingsBuilder
Assembly: Syncfusion.EJ2.dll
Syntax
public class ChartDataLabelSettingsBuilder : ControlBuilder
Constructors
ChartDataLabelSettingsBuilder()
Declaration
public ChartDataLabelSettingsBuilder()
ChartDataLabelSettingsBuilder(ChartDataLabelSettings)
Declaration
public ChartDataLabelSettingsBuilder(ChartDataLabelSettings model)
Parameters
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
Returns
Angle(Double)
Specifies the rotation angle of the data label.
Declaration
public ChartDataLabelSettingsBuilder Angle(double value)
Parameters
Type |
Name |
Description |
System.Double |
value |
|
Returns
Border(ChartBorder)
Configures the appearance of the border lines with options for width and color properties.
Declaration
public ChartDataLabelSettingsBuilder Border(ChartBorder value)
Parameters
Returns
Border(Action<ChartBorderBuilder>)
Declaration
public ChartDataLabelSettingsBuilder Border(Action<ChartBorderBuilder> border)
Parameters
Returns
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
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
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
Returns
Font(Action<ChartFontBuilder>)
Declaration
public ChartDataLabelSettingsBuilder Font(Action<ChartFontBuilder> font)
Parameters
Returns
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
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
Returns
Margin(ChartMargin)
Configures the margin for the data label.
Declaration
public ChartDataLabelSettingsBuilder Margin(ChartMargin value)
Parameters
Returns
Margin(Action<ChartMarginBuilder>)
Declaration
public ChartDataLabelSettingsBuilder Margin(Action<ChartMarginBuilder> margin)
Parameters
Returns
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
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
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
Returns
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
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
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
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
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