Skip to main content

IChartSeries Interface

Implements the chart series settings.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.1.dll

NuGet Package: DevExpress.Blazor

Declaration

public interface IChartSeries :
    IChartSeriesBase

The following members return IChartSeries objects:

Remarks

The IChartSeries interface allows you to access series settings when you handle the SeriesClick event.

The following code sample obtains data when you click a chart’s series point:

Full-Stacked Series point click

@using Chart.Data

<DxChart Data="@SalesData" SeriesClick=@OnPointClick>
    <DxChartStackedBarSeries Name="2017"
                                 Filter="@((SaleInfo s) => s.Date.Year == 2017)"
                                 SummaryMethod="Enumerable.Sum"
                                 ArgumentField="@(s => s.City)"
                                 ValueField="@(s => s.Amount)" />
    <DxChartStackedBarSeries Name="2018"
                                 Filter="@((SaleInfo s) => s.Date.Year == 2018)"
                                 SummaryMethod="Enumerable.Sum"
                                 ArgumentField="@(s => s.City)"
                                 ValueField="@(s => s.Amount)" />
    <DxChartStackedBarSeries Name="2019"
                                 Filter="@((SaleInfo s) => s.Date.Year == 2019)"
                                 SummaryMethod="Enumerable.Sum"
                                 ArgumentField="@(s => s.City)"
                                 ValueField="@(s => s.Amount)" />
    <DxChartSplineSeries Name="Total"
                         SummaryMethod="Enumerable.Sum"
                         ArgumentField="@((SaleInfo s) => s.City)"
                         ValueField="@(s => s.Amount)"
                         />
</DxChart>
@if ((ClickedPointArgs != null) && (ClickedPointArgs.Point != null)) {
    <div id="point-args">
        <table><tr> <td>Series Name:</td><td>@ClickedPointArgs.Series.Name</td> </tr>
            <tr> <td>Stack:</td><td> @(((IChartSeries)ClickedPointArgs.Series).Stack)</td> </tr>
            <tr> <td>Point Value:</td><td> @ClickedPointArgs.Point.Value</td> </tr>
            <tr> <td>Argument:</td><td> @ClickedPointArgs.Point.Argument</td> </tr>
            @foreach(SaleInfo item in ClickedPointArgs.Point.DataItems) {
                <tr><td>Point Item:</td><td>@item.Amount in @item.City</td> </tr>
            }
        </table>
    </div>
}
@code {
    ChartSeriesClickEventArgs ClickedPointArgs { get; set; }
    IEnumerable<SaleInfo> SalesData;

    protected override async Task OnInitializedAsync()
    {
        SalesData = await Sales.GetSalesAsync();
    }

    void OnPointClick(ChartSeriesClickEventArgs pointArgs) {
        ClickedPointArgs = pointArgs;
    }
}
See Also