Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

IChartSeriesLabel Interface

Defines a point’s label settings.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
public interface IChartSeriesLabel

The following members return IChartSeriesLabel objects:

#Remarks

IChartSeriesLabel properties allow you to configure point label settings. To access these settings, use the PointLabel property in a CustomizeSeriesPoint event handler.

The following properties are available:

Visible
Allows you to hide or display series labels.
Alignment | HorizontalOffset | VerticalOffset | Position
Specify label location.
RotationAngle
Specifies the rotation angle of series labels.
BackgroundColor | Border | Connector
Customize label appearance.
Texts | Font | FormatPattern
Configure text content and settings for series labels.
ShowForZeroValues
Allows you to hide or display labels for series points with zero values.

#Example

The following example demonstrates how to:

  • use the DxChartSeriesLabel component to specify the position of all labels;
  • use the DxChartSeriesLabelConnector component to customize connectors between data points and labels;
  • handle the CustomizeSeriesPoint event to show only labels whose values are between 25 and 75.
@inject WeatherForecastService ForecastService

<DxChart Data="@ChartData" CustomizeSeriesPoint="@PreparePointLabel">
    <DxChartLineSeries AggregationMethod="@(i => (int)i.Average())"
                       ValueField="@((WeatherForecast i) => i.TemperatureF)"
                       ArgumentField="@(i => i.Date.Date)"
                       Name="Temperature, F">
        <DxChartSeriesLabel Position="RelativePosition.Outside">
            <DxChartSeriesLabelConnector Visible="true" Width="3" />
        </DxChartSeriesLabel>
    </DxChartLineSeries>
</DxChart>

@code {
    WeatherForecast[] ChartData;

    protected override async Task OnInitializedAsync() {
        ChartData = await ForecastService.GetForecastAsync();
    }

    protected void PreparePointLabel(ChartSeriesPointCustomizationSettings pointSettings) {
        double value = (double)pointSettings.Point.Value;
        if (value > 25 && value < 75)
            pointSettings.PointLabel.Visible = true;
    }
}

Chart Series Labels

Run Demo: Charts - Series Label Customization

See Also