Class ChartLastDataLabel
Defines the options used to display and customize the label for the last visible value in a ChartSeries.
Implements
Inherited Members
Namespace: Syncfusion.Blazor.Toolkit.Charts
Assembly: Syncfusion.Blazor.Toolkit.dll
Syntax
public class ChartLastDataLabel : ChartSubComponent, IAsyncDisposable, ISubcomponentTracker, IChartElement
Remarks
Use this component to highlight the most recent data point in a series with a label and an optional horizontal indicator line. Appearance can be customized through properties such as Background, LineColor, DashArray, LineWidth, and corner radii Rx / Ry. To style the label's text and outline, use the nested ChartLastDataLabelFont and ChartLastDataLabelBorder subcomponents.
Examples
<SfChart>
<ChartSeries XName="X" YName="Y" DataSource="@StockData" Type="ChartSeriesType.Line">
<ChartLastDataLabel ShowLabel="true"
Background="rgba(0,0,0,0.5)"
LineColor="black"
LineWidth="1"
DashArray="4,2"
Rx="6"
Ry="6">
<ChartLastDataLabelBorder Color="white" Width="1" />
<ChartLastDataLabelFont Size="12px" FontWeight="600" Color="white" />
</ChartLastDataLabel>
</ChartSeries>
</SfChart>
Constructors
ChartLastDataLabel()
Declaration
public ChartLastDataLabel()
Properties
Background
Gets or sets the background color of the last value label.
Declaration
public string Background { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String | A |
Remarks
Use a contrasting color to ensure the label remains legible over colored or complex chart backgrounds.
Examples
<ChartLastDataLabel Background="red" />
DashArray
Gets or sets the dash pattern for the grid line behind the last value label.
Declaration
public string DashArray { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String | A |
Remarks
Use dash patterns to visually distinguish the indicator from other grid or series lines.
Examples
<ChartLastDataLabel DashArray="2,5" />
LineColor
Gets or sets the color of the indicator line displayed behind the last value label.
Declaration
public string LineColor { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String | A |
Remarks
Provides a clear horizontal reference to the last value to improve readability.
Examples
<ChartLastDataLabel LineColor="black" />
LineWidth
Gets or sets the width of the indicator line displayed behind the last value label.
Declaration
public double LineWidth { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Double | A |
Remarks
Thicker lines can improve visibility, especially for dense charts or when multiple series are present.
Examples
<ChartLastDataLabel LineWidth="0.5" />
Rx
Gets or sets the horizontal radius of the rounded corners of the last data label's background.
Declaration
public double Rx { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Double | A System.Double representing the horizontal radius. The default is 5. |
Remarks
This applies when ChartLastDataLabelBorder is enabled.
Examples
<ChartLastDataLabel Rx="10">
<ChartLastDataLabelBorder Color="Green" Width="1" />
</ChartLastDataLabel>
Ry
Gets or sets the vertical radius of the rounded corners of the last data label's background.
Declaration
public double Ry { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Double | A System.Double representing the vertical radius. The default is 5. |
Remarks
This applies when ChartLastDataLabelBorder is enabled.
Examples
<ChartLastDataLabel Ry="10">
<ChartLastDataLabelBorder Color="Green" Width="1" />
</ChartLastDataLabel>
ShowLabel
Gets or sets a value indicating whether the label and indicator for the last data point in the series are visible.
Declaration
public bool ShowLabel { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
|
Remarks
Toggle this to highlight the end point of a trend, improving readability for monitoring scenarios and dashboards.
Examples
<ChartLastDataLabel ShowLabel="true" />