Skip to main content

DxChartCommonSeries<T, TGroup, TValue, TArgument>.SeriesTemplate Property

Specifies a series template.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

Declaration

[Parameter]
public RenderFragment<ChartSeriesSettings<T, TGroup, TValue, TArgument>> SeriesTemplate { get; set; }

Property Value

Type Description
RenderFragment<ChartSeriesSettings<T, TGroup, TValue, TArgument>>

The template content.

Remarks

Use the template’s context parameter to access the series settings (a ChartSeriesSettings object).

<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.GroupKey == 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