Back to Devexpress

DxPieChartSeries<T, TArgument, TValue>.ArgumentField Property

blazor-devexpress-dot-blazor-dot-dxpiechartseries-3-205983d6.md

latest2.5 KB
Original Source

DxPieChartSeries<T, TArgument, TValue>.ArgumentField Property

Specifies a data source field that contains arguments for series values.

Namespace : DevExpress.Blazor

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

csharp
[Parameter]
public Expression<Func<T, TArgument>> ArgumentField { get; set; }

Property Value

TypeDescription
Expression<Func<T, TArgument>>

The name of the field.

|

Remarks

Use the Data property to bind the Chart to an IEnumerable<T> data source. Set the ArgumentField and ValueField properties to data source fields that contain arguments and values for chart points.

razor
<DxPieChart Data="@SalesData">
    <DxPieChartSeries T="SaleInfo"
                      TArgument="string"
                      TValue="double"
                      ValueField="si => si.Amount"
                      ArgumentField="si => si.Region"
                      SummaryMethod="Enumerable.Sum">
    </DxPieChartSeries>
    <DxChartLegend Position="RelativePosition.Outside" />
</DxPieChart>

If you set the ArgumentField or ValueField property to a DateTime data field that contains a time part, the SummaryMethod property may not be applicable. To avoid this situation, extract the day part only as shown in the example below:

razor
<DxPieChart Data="@SalesData">
    <DxPieChartSeries T="SaleInfo"
                      TArgument="string"
                      TValue="double"
                      ArgumentField="@(s => s.Date.Date)" 
                      ValueField="@((SalesInfo s) => s.Amount)" />
</DxChart>

Run Demo: Pie Chart

See Also

DxPieChartSeries<T, TArgument, TValue> Class

DxPieChartSeries<T, TArgument, TValue> Members

DevExpress.Blazor Namespace