DxChartCommonSeries<T, TGroup, TValue, TArgument>.AggregationMethod Property
Specifies how to aggregate series points.
Namespace: DevExpress.Blazor
Assembly: DevExpress.Blazor.v20.2.dll
NuGet Package: DevExpress.Blazor
Declaration
[Parameter]
public Func<IEnumerable<TValue>, TValue> AggregationMethod { get; set; }
Property Value
Type | Description |
---|---|
Func<IEnumerable<TValue>, TValue> | A method defined by the Func<IEnumerable<T>, T> signature. For example, Sum(IEnumerable<Int32>). |
Remarks
Use the AggregationMethod property to specify an aggregation method used to calculate series values.
<DxChart Data="@ChartsData">
<DxChartCommonSeries NameField="@((SaleInfo s) => s.Date.Year)" Filter="@((SaleInfo s) => s.Region == "Europe")"
AggregationMethod="Enumerable.Sum" ArgumentField="@((SaleInfo s) => s.City)"
ValueField="@((SaleInfo s) => s.Amount)" SeriesType="@(ChartSeriesType.Bar)" />
</DxChart>
If you do not specify an aggregation method for a series point, the chart displays all the specified points without aggregating a similar argument’s values.
[{arg1, val1}, {arg2, val2}, {arg1, val3}] => [{arg1, val1}, {arg2, val2}, {arg1, val3}]
If the aggregation method is specified, the chart only displays unique arguments with the corresponding aggregated values.
[{arg1, val1}, {arg2, val2}, {arg1, val3}] => [{arg1, aggregationFunc([val1, val3])}, {arg2, val2}]
Online Demo
See Also