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

DxChartSeriesLegendItem.TextTemplate Property

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

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
[Parameter]
public RenderFragment<string> TextTemplate { get; set; }

#Property Value

Type Description
RenderFragment<String>

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

#Remarks

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

Note

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

Razor
<DxChartLineSeries Name="2019">
    <DxChartSeriesLegendItem>
        <TextTemplate>
            <b>Last year</b>
        </TextTemplate>
    </DxChartSeriesLegendItem>
</DxChartLineSeries>

Charts - Legend item text

Run Demo: Charts - Legend Customization

See Also