4.00
2
$3.50
1.50
4
$14.40
$
4.00
2
$3.50
8.22
6
$21.60
9.56
3
$9.75
5.84
5
$8.75
12.25
2
$7.20
1.56
3
$9.75
1.00
2
$3.50
0.00
1
$3.60
2.25
6
$19.50
13.19
4
$7.00
4.67
3
$10.80
0.00
1
$3.25
0.00
2
$3.50
0.00
1
$3.60
8.56
5
$16.25
0.00
1
$1.75
3.56
3
$10.80
2.25
2
$6.50
12.25
2
$3.50
0.25
2
$7.20
6.25
2
$6.50
1.50
4
$7.00
0.00
1
$3.60
0.00
1
$3.25
0.00
2
$3.50
6.25
2
$7.20
20.25
2
$6.50
0.00
1
$1.75
2.96
5
$18.00
9.00
4
$13.00
0.00
1
$1.75
9.00
2
$7.20
1.19
4
$13.00
Beate
Elio
Ian
Guylene
Andrew
Petra
Lars
Regina
Antoni
Cheryl
Peter
Mayumi
Espresso con Panna
sum
count
variance
White Chocolate Mocha
sum
count
variance
Espresso Truffle
sum
count
variance

Description

This is an example of the React Pivot Grid with custom a custom data aggregation function. The pivot grid component provides several built-in functions: count, sum, min, max, average, product. In this example, we implement a custom function that calculates the variance of the data points of the respective pivot grid cell. To add or modify existing data aggregations, set the customAggregationFunctions property of the pivot data source. Each pivot aggregation functions must have a unique name, take an array of values as a parameter and return a number. For performance reasons, make sure that the function runs as quickly as possible. The React pivot grid will call the function multiple times during the data pivoting operations.