Skip to main content

DxChartSeriesLegendItem.TextTemplate Property

Specifies the template to display a series legend item’s text.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v22.2.dll

NuGet Package: DevExpress.Blazor


public RenderFragment<string> TextTemplate { get; set; }

Property Value

Type Description

A UI fragment to be rendered as a legend item’s text.


Use the TextTemplate property to customize the legend item’s text. The code below applies the bold style to the legend item’s text.


The AllowToggleSeries property does not affect legend items that use text templates.

<DxChartLineSeries Name="2019">
            <b>Last year</b>

Charts - Legend item text

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">
            <TextTemplate>City: @context</TextTemplate>

Donut Chart Legend

See Also