Skip to main content
A newer version of this page is available.
All docs
V20.2

DxChartSeries<T, TArgument, TValue, TAggregate, TModel>.AggregationMethod Property

Specifies how to aggregate series values.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v20.2.dll

NuGet Package: DevExpress.Blazor

Declaration

[Parameter]
public Func<IEnumerable<TAggregate>, TAggregate> AggregationMethod { get; set; }

Property Value

Type Description
Func<IEnumerable<TAggregate>, TAggregate>

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="@SalesData">
    <DxChartTitle Text="Sales amount" />
    <DxChartBarSeries Name="2017" Filter="@((SaleInfo s) => s.Date.Year == 2017)" 
                      AggregationMethod="Enumerable.Sum" ArgumentField="@(s => s.City)" ValueField="@(s => s.Amount)" />
    <DxChartBarSeries Name="2018" Filter="@((SaleInfo s) => s.Date.Year == 2018)" 
                      AggregationMethod="Enumerable.Sum" ArgumentField="@(s => s.City)" ValueField="@(s => s.Amount)" />
    <DxChartLineSeries Name="2019" Filter="@((SaleInfo s) => s.Date.Year == 2019)" 
                       AggregationMethod="Enumerable.Sum" ArgumentField="@(s=> s.City)" ValueField="@(s => s.Amount)" />
</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

Charts - Customization

See Also