DxChartSeriesLegendItem.Text Property

Specifies a legend item’s text.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v21.1.dll

Declaration

[Parameter]
public string Text { get; set; }

Property Value

Type Description
String

A legend item’s text.

Remarks

The Chart component generates a legend item’s text based on the corresponding series’s name. To override the generated legend item’s text, use the Text property.

<DxChartLineSeries Name="2019" Filter="@((SaleInfo s) => s.Date.Year == 2019)" 
                   SummaryMethod="Enumerable.Sum" 
                   ArgumentField="@(s=> s.City)" ValueField="@(s => s.Amount)">
    <DxChartSeriesLegendItem IconCssClass="oi oi-flag" Text="Last year"/>
</DxChartLineSeries>

Chart Legend

Run Demo: Charts - Legend Customization

Pie and Donut charts consists of one series only. You should specify one DxChartSeriesLegendItem item for these charts. The specified settings are applied to all legend items in the chart.

<DxChart Data="@SalesData">
    <DxChartTitle Text="Total Sales" />
    <DxChartLegend VerticalAlignment="VerticalEdge.Bottom" Position="RelativePosition.Outside" />
    <DxChartDonutSeries ValueField="@((SaleInfo i) => i.Amount)" 
                        ArgumentField="@(i => i.City)" 
                        SummaryMethod="Enumerable.Sum">
        <DxChartSeriesLabel Visible="true" />
        <DxChartSeriesLegendItem IconCssClass="oi oi-flag" Text="Sales"/>
    </DxChartDonutSeries>
</DxChart>

Donut Chart Legend

See Also