Aggregate
Represents the PivotGrid aggregate object. Applicable for local data binding.
Definition
Package:@progress/kendo-react-pivotgrid
Syntax:
const sumAggregate: Aggregate = {
init: (data) => { data.sum = ('sum' in data) ? data.sum : 0; },
accumulate: (data, value) => { data.sum += value; },
merge: (src, dest) => { dest.sum += src.sum; },
result: data => data.sum,
format: (value: number) => value.toFixed(2)
};
Properties
accumulate
(data: any, value: any) => void
The accumulate function will be called for every value that needs to be aggregated.
The aggregated data so far.
The value that needs be aggregated in data object.
The format function will be called when the value returned from the result function needs to be formatted.
The aggregated value.
Returns:string
init
(data: any) => void
The init function initializes the variable where the aggregated data will be stored and returns it in the passed data object.
The init function will be called every time before calling accumulate and merge functions.
The data object where the aggregated data will be stored.
merge
(src: any, dest: any) => void
The merge function will be called when two aggregated data objects needs to be merged into one.
The source aggregated data object.
The destination aggregated data object.
The result function will be called when the aggregated value needs to be extracted from the data object.
The aggregated data object.
any