Skip to main content

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

DxChartSeriesLabel.BackgroundColor Property

Specifies the label background color.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
[Parameter]
public Color BackgroundColor { get; set; }

#Property Value

Type Description
Color

The background color.

#Remarks

The label background color depends on the color of the corresponding series or point. Use the BackgroundColor property to customize the label background color.

#Pie Chart Specifics

When the DxChartSeriesLabel.Position property is set to Inside, series labels may go beyond the boundaries of pie sectors. In this case, set the BackgroundColor property to transparent to display series labels correctly:

Pie Chart - Set the Label Background Color to Transparent

Razor
@using System.Drawing

<DxPieChart Data="@SalesData"
            InnerDiameter="0.5"
            T="SaleInfo">
    <DxPieChartSeries T="SaleInfo"
                      TArgument="string"
                      TValue="double"
                      ValueField="si => si.Amount"
                      ArgumentField="si => si.Country"
                      SummaryMethod="Enumerable.Sum">
        <DxChartSeriesLabel Visible="true"
                            Position="RelativePosition.Inside"
                            ValueFormat="ChartElementFormat.Thousands(1)"
                            BackgroundColor="System.Drawing.Color.Transparent">
        </DxChartSeriesLabel>
    </DxPieChartSeries>
    <DxChartTitle Text="Sales by Country">
        <DxChartSubTitle Text="USD" />
    </DxChartTitle>
    @* ... *@
</DxPieChart>
See Also