blazor-devexpress-dot-blazor-dot-ichartserieslabel-fe822d68.md
Specifies the label background color.
Namespace : DevExpress.Blazor
Assembly : DevExpress.Blazor.v25.2.dll
NuGet Package : DevExpress.Blazor
Color BackgroundColor { get; set; }
| Type | Description |
|---|---|
| Color |
The background color.
|
IChartSeriesLabel properties allow you to configure point label settings. To access these settings, use the PointLabel property in a CustomizeSeriesPoint event handler.
The following code snippet customizes the background color of visible point labels:
<DxChart Data="@WeatherForecasts"
CustomizeSeriesPoint="@PreparePointLabel">
<DxChartLineSeries SummaryMethod="@(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>
<DxChartLegend Position="RelativePosition.Outside" />
</DxChart>
@code {
WeatherForecast[] WeatherForecasts;
// ...
protected void PreparePointLabel(ChartSeriesPointCustomizationSettings pointSettings) {
double value = (double)pointSettings.Point.Value;
if(value > 25 && value < 75) {
pointSettings.PointLabel.Visible = true;
pointSettings.PointLabel.BackgroundColor = System.Drawing.Color.Red;
}
}
}
Run Demo: Charts - Series Label Customization
See Also