Skip to main content

DxChartCommonSeries<T, TGroup, TValue, TArgument> Class

Defines a common series.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

Declaration

public class DxChartCommonSeries<T, TGroup, TValue, TArgument> :
    DxSettingsComponent<ChartCommonSeriesBaseModel>,
    INestedSettingsOwner

Type Parameters

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.

Remarks

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.

Series Type Specifics

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:

Chart - Dynamic Series Creation

<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

Inheritance

Object
ComponentBase
DxSettingsComponent<DevExpress.Blazor.Internal.ChartCommonSeriesBaseModel>
DxChartCommonSeries<T, TGroup, TValue, TArgument>
See Also