blazor-devexpress-dot-blazor-dot-dxchartcommonseries-4.md
Defines a common series.
Namespace : DevExpress.Blazor
Assembly : DevExpress.Blazor.v25.2.dll
NuGet Package : DevExpress.Blazor
public class DxChartCommonSeries<T, TGroup, TValue, TArgument> :
DxSettingsComponent<ChartCommonSeriesBaseModel>,
INestedSettingsOwner
| Name | Description |
|---|---|
| T |
The type of data.
| | TGroup |
The type of group key.
| | TValue |
The type of series values.
| | TArgument |
The type of series arguments.
|
Add a DxChartCommonSeries object to the DxChart component markup to create a common series and change the series type dynamically.
Note
DxChart<T> can contain only one DxChartCommonSeries object. To visualize data with multiple series types, use the DxChartCommonSeries.SeriesTemplate property or add individual series to the chart markup.
Use the SeriesType property to create a common XY series (for example, line, bar, or area).
The following code snippet uses a drop-down menu to change the series type dynamically:
<label><b>Series Type:</b></label>
<DxComboBox Data="Enum.GetValues<ChartSeriesType>()"
@bind-Value="@CurrentSeriesType" />
<DxChart Data="@SalesData">
<DxChartTitle Text="Sales amount, $" />
<DxChartCommonSeries SummaryMethod="Enumerable.Sum"
NameField="@((SaleInfo s) => s.Date.Year)"
ArgumentField="@((SaleInfo s) => s.City)"
ValueField="@((SaleInfo s) => s.Amount)"
SeriesType="@CurrentSeriesType">
</DxChartCommonSeries>
@* ... *@
</DxChart>
@code {
ChartSeriesType CurrentSeriesType = ChartSeriesType.Line;
IEnumerable<SaleInfo> SalesData;
protected override async Task OnInitializedAsync() {
SalesData = await Sales.GetSalesAsync();
}
}
To generate series that require specific settings in addition to ArgumentField and ValueField (for example, bubble or stock series), use the SeriesTemplate property.
Run Demo: Charts - Autogenerated Series
Object ComponentBase DxSettingsComponent<DevExpress.Blazor.Internal.ChartCommonSeriesBaseModel> DxChartCommonSeries<T, TGroup, TValue, TArgument>
See Also