alexa
menu

Blazor Toolkit

    Show / Hide Table of Contents

    Class ChartLastDataLabel

    Defines the options used to display and customize the label for the last visible value in a ChartSeries.

    Inheritance
    System.Object
    SfBaseComponent
    ChartSubComponent
    ChartLastDataLabel
    Implements
    System.IAsyncDisposable
    Inherited Members
    SfBaseComponent.DisposeAsync()
    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 string representing the background color (e.g., #ffffff, rgba(0,0,0,0.25), or transparent). The default value is transparent (theme-dependent).

    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 string defining the dash array (e.g., "4,2" for dashed lines). An empty string renders a solid line.

    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 string specifying the line color. If empty, the series color is used.

    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 double specifying the thickness of the indicator line. The default value is 1.

    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

    true to display the last value label and the corresponding grid line indicator; otherwise, false. The default value is false.

    Remarks

    Toggle this to highlight the end point of a trend, improving readability for monitoring scenarios and dashboards.

    Examples
    <ChartLastDataLabel ShowLabel="true" />

    Implements

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