Skip to main content

ChartSeriesSettings<T, TValue, TArgument> Class

Defines Chart series settings.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v21.2.dll

Declaration

public abstract class ChartSeriesSettings<T, TValue, TArgument> :
    IChartSeriesDataSettings<T, TValue, TArgument>

Type Parameters

Name Description
T

The data item type.

TValue

The value axis type.

TArgument

The argument axis type.

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.

<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

Inheritance

Object
ChartSeriesSettings<T, TValue, TArgument>
See Also