ChartSeriesSettings<T, TValue, TArgument>.Data Property
In This Article
Contains current series data.
Namespace: DevExpress.Blazor
Assembly: DevExpress.Blazor.v24.2.dll
NuGet Package: DevExpress.Blazor
#Declaration
C#
public IEnumerable<T> Data { get; protected set; }
#Property Value
Type | Description |
---|---|
IEnumerable<T> | Series data. |
#Remarks
The following example uses 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