Skip to main content

DxPieChartSeries<T, TArgument, TValue>.SummaryMethod Property

Specifies the method that calculates summaries for points with the same argument value.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v23.2.dll

NuGet Package: DevExpress.Blazor

Declaration

[Parameter]
public Func<IEnumerable<TValue>, TValue> SummaryMethod { 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

The Chart component can use a summary method to group data. This method calculates summaries for points with the same argument value, and the chart shows the resulting values as series points. This feature allows you to decrease the number of visible points and to optimize chart performance.

Note that the chart calculates summaries when it loads data and does not re-calculate them when users zoom the chart.

Data Summaries

The following example aggregates the number of visible points with the same argument value. The SummaryMethod property specifies the Sum function for this aggregation.

<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>

@code {
    IEnumerable<SaleInfo> SalesData;

    protected override async Task OnInitializedAsync() {
        SalesData = await Sales.GetSalesAsync();
    }
}

Chart Line Series

See Also