blazor-devexpress-dot-blazor-dot-dxchartxyseries-4-6dc4c861.md
Accepts series settings when you create a series template.
Namespace : DevExpress.Blazor
Assembly : DevExpress.Blazor.v25.2.dll
NuGet Package : DevExpress.Blazor
[Parameter]
public ChartSeriesSettings<T, TValue, TArgument> Settings { get; set; }
| Type | Description |
|---|---|
| ChartSeriesSettings<T, TValue, TArgument> |
The settings of a series.
|
The SeriesTemplate property allows you to specify a template for a series. The property gets an object of the ChartSeriesSettings<T, TGroupKey, TValue, TArgument> type that contains information about the currently rendered series. This object can be accessed in the template rendering process by the context parameter.
Assign the context to the Settings property to specify settings for the rendered series.
@inject ISalesInfoDataProvider Sales
<DxChart @ref="@chart"
Data="@chartData"
LabelOverlap="ChartLabelOverlap.Hide"
Width="100%">
<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 == 2019) {
<DxChartLineSeries Name='Last year'
Settings="@settings" />
}
else {
<DxChartBarSeries Settings="@settings">
<DxChartSeriesLabel Visible="true" />
</DxChartBarSeries>
}
</SeriesTemplate>
</DxChartCommonSeries>
</DxChart>
Run Demo: Charts - Autogenerated Series
See Also
DxChartXYSeries<T, TArgument, TValue, TAggregate> Class