Back to Devexpress

DxChartSeriesLabel.BackgroundColor Property

blazor-devexpress-dot-blazor-dot-dxchartserieslabel-5f4f6bd1.md

latest2.2 KB
Original Source

DxChartSeriesLabel.BackgroundColor Property

Specifies the label background color.

Namespace : DevExpress.Blazor

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

csharp
[Parameter]
public Color BackgroundColor { get; set; }

Property Value

TypeDescription
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:

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

DxChartSeriesLabel Class

DxChartSeriesLabel Members

DevExpress.Blazor Namespace