ChartSeriesSettings<T, TGroupKey, TValue, TArgument> Class
Defines Chart series settings.
Namespace: DevExpress.Blazor
Assembly: DevExpress.Blazor.v21.2.dll
NuGet Package: DevExpress.Blazor
Declaration
public class ChartSeriesSettings<T, TGroupKey, TValue, TArgument> :
ChartSeriesSettings<T, TValue, TArgument>
Type Parameters
Name | Description |
---|---|
T | The data item type. |
TGroupKey | The data type of a field specified by the NameField property. |
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>