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>.NameField Property

Specifies a data source field used to group data by series.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
[Parameter]
public Expression<Func<T, TGroup>> NameField { get; set; }

#Property Value

Type Description
Expression<Func<T, TGroup>>

A lambda expression that returns series names.

#Remarks

Use the NameField option to specify a data source field that is used to group data. Every group defines data for a particular series. The series Name property is set to a group key.

Razor
<DxChart Data="@ChartsData">
    <DxChartCommonSeries NameField="@((SaleInfo s) => s.Date.Year)"
                         Filter="@((SaleInfo s) => s.Region == "Europe")" 
                         SummaryMethod="Enumerable.Sum"
                         ArgumentField="@((SaleInfo s) => s.City)" 
                         ValueField="@((SaleInfo s) => s.Amount)"
                         SeriesType="@(ChartSeriesType.Bar)" />
</DxChart>

Chart Common Series

Run Demo: Charts - Autogenerated Series

See Also