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

ChartSeriesSettings<T, TValue, TArgument>.Name Property

Specifies a series name.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
public virtual string Name { get; set; }

#Property Value

Type Description
String

A series name.

#Remarks

The SeriesTemplate property allows you to specify a template for a Chart series. The property gets an object of the ChartSeriesSettings type that contains information about the rendered series. To access this object, use the template’s context parameter.

Assign the obtained context to the Settings property to specify settings for the rendered series. The context.Name property allows you to specify a series name whose values are used within a template.

Razor
<DxChart Data="@GridData">
    <DxChartTitle Text="Sales amount" />
    <DxChartCommonSeries
            SummaryMethod="Enumerable.Sum"
            NameField="@((SaleInfo s) => s.Date.Year)" 
            ArgumentField="@((SaleInfo s) => s.City)" 
            ValueField="@((SaleInfo s) => s.Amount)">
        <SeriesTemplate Context="settings">
            @if(settings.Name == "2015") {
                <DxChartLineSeries Name="Last year" Settings="@settings">
                </DxChartLineSeries>
            } else {
                <DxChartBarSeries Settings="@settings">
                    <DxChartSeriesLabel Visible="true"></DxChartSeriesLabel>
                </DxChartBarSeries>
            }
        </SeriesTemplate>
    </DxChartCommonSeries>
</DxChart>

Chart Series Template

Run Demo: Charts - Dynamic Series

See Also