Skip to main content

ChartSeriesSettings<T, TValue, TArgument>.Data Property

Contains current series data.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v23.2.dll

NuGet Package: DevExpress.Blazor

Declaration

public IEnumerable<T> Data { get; protected set; }

Property Value

Type Description
IEnumerable<T>

Series data.

Remarks

The following example shows how to use the Data property to set the Stack property value in a SeriesTemplate. The stacks in the chart below correspond to gender.

<DxChart T="PopulationAgeStructureItem"
         Data="@ChartsData"
         Width="100%">
    <DxChartCommonSeries T="PopulationAgeStructureItem"
                         TArgument="string"
                         TValue="int"
                         TGroup="string"
                         NameField='pasi => $"{pasi.Gender}: {pasi.AgeGroup}"'>
        <SeriesTemplate Context="settings">
            <DxChartStackedBarSeries Settings="@settings"
                                     ArgumentField="pasi => pasi.Country"
                                     ValueField="pasi => pasi.Population"
                                     Stack="@settings.Data.First().Gender" />
        </SeriesTemplate>
    </DxChartCommonSeries>
    @* ... *@
</DxChart>

@code {
    IEnumerable<PopulationAgeStructureItem> ChartsData;
    protected override async Task OnInitializedAsync()
    {
        ChartsData = await DataProvider.QueryData();
    }
}
See Also