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.Font Property

Returns label font settings.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
IChartFont Font { get; }

#Property Value

Type Description
IChartFont

Label font settings.

#Remarks

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

The Font property allows you to access and modify the following font settings:

Color | Opacity
Specify the text color and its opacity.
Family | Weight
Specify font style settings.
Size
Specifies font size.

#Example

The following code snippet configures font settings of visible point labels:

Chart - Label Font Customization

Razor
<DxChart Data="@WeatherForecasts"
         CustomizeSeriesPoint="@PreparePointLabel"
         Width="100%">
    <DxChartTitle Text="Annual Weather in New York" />
    <DxChartLineSeries SummaryMethod="@(i => i.Average())"
                       ValueField="@((DetailedWeatherSummary i) => i.AverageTemperatureF)"
                       ArgumentField="@(i => new DateTime(2000, i.Date.Month, 1))"
                       Name="Temperature, F"
                       Filter="@((DetailedWeatherSummary  i) => i.City == "NEW YORK")">
        <DxChartSeriesLabel Position="RelativePosition.Outside"
                            FormatPattern="{argument:MMMM}: {value:#.##} °F">
            <DxChartSeriesLabelConnector Visible="true"
                                         Width="3" />
            <DxChartFont Size="14" Weight="600"/>
        </DxChartSeriesLabel>
    </DxChartLineSeries>
    @* ... *@
</DxChart>

@code {
    WeatherForecast[] WeatherForecasts;
    // ...

    protected void PreparePointLabel(ChartSeriesPointCustomizationSettings pointSettings) {
        double value = (double)pointSettings.Point.Value;
        if (value > 50 && value < 70)
            pointSettings.PointLabel.Visible = true;
            // ...
            pointSettings.PointLabel.Font.Color = "black";
            pointSettings.PointLabel.Font.Weight = 400;
    }
}
See Also