DxChartCommonSeries<T, TGroup, TValue, TArgument>.SummaryMethod Property
Specifies the method that calculates summaries for points with the same argument value.
Namespace: DevExpress.Blazor
Assembly: DevExpress.Blazor.v24.1.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.
Use the DxChartCommonSeries.SummaryMethod
property to specify a summary method for all chart series. To specify an individual method for each series, use the DxChartSeries.SummaryMethod property.
<DxChart Data="@SalesData">
<DxChartCommonSeries NameField="@((SaleInfo s) => s.Date.Year)"
ArgumentField="@((SaleInfo s) => s.City)"
ValueField="@((SaleInfo s) => s.Amount)"
SeriesType="ChartSeriesType.Bar"
SummaryMethod="Enumerable.Max">
</DxChartCommonSeries>
</DxChart>
@code {
IEnumerable<SaleInfo> SalesData;
protected override async Task OnInitializedAsync() {
SalesData = await Sales.GetSalesAsync();
}
}
Summaries vs Aggregation
You can also use aggregation methods to decrease the number of visible points and optimize the chart performance.
The table below describes the difference between aggregation and summaries.
Aggregation | Summaries | |
---|---|---|
Points to Group | The chart aggregates points with different argument values (on a specific interval of X-axis). | The chart calculates summaries for points with the same argument value. |
Behavior on Zoom | The chart aggregates data when it loads them and re-aggregates data when users zoom the chart. | The chart calculates summaries only when it loads data. |