Back to Devexpress

IChartFont Interface

blazor-devexpress-dot-blazor-e6f53acc.md

latest2.7 KB
Original Source

IChartFont Interface

Contains the element’s font settings.

Namespace : DevExpress.Blazor

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

csharp
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 | OpacitySpecify the text color and its opacity.Family | WeightSpecify font style settings.SizeSpecifies font size.

Example

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

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

IChartFont Members

DevExpress.Blazor Namespace