Skip to main content
All docs
V24.1

IChartFont Interface

Contains the element’s font settings.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.1.dll

NuGet Package: DevExpress.Blazor

Declaration

public interface IChartFont

The following members return IChartFont objects:

Remarks

Use the Font property in a CustomizeSeriesPoint event handler 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

<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