Skip to main content

DxChartSeriesLegendItem.Text Property

Specifies a legend item’s text.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v23.2.dll

NuGet Package: DevExpress.Blazor


public string Text { get; set; }

Property Value

Type Description

A legend item’s text.


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)" 
                   ArgumentField="@(s=> s.City)" ValueField="@(s => s.Amount)">
    <DxChartSeriesLegendItem IconCssClass="oi oi-flag" Text="Last year"/>

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)" 
        <DxChartSeriesLabel Visible="true" />
        <DxChartSeriesLegendItem IconCssClass="oi oi-flag" Text="Sales"/>

Donut Chart Legend

See Also