Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

DxChartCommonSeries<T, TGroup, TValue, TArgument> Class

Defines a common series.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
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.

#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:

Razor
<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