This sample demonstrates the aggregate functionality of the Grid. In this sample, the aggregate values for the columns are displayed in the column footer.
Time Stamp | Sales | Marketing Spend | New Customers | Returning Customers | Web Traffic |
---|---|---|---|---|---|
January 2024 | $51,000.00 | $9,000.00 | 180 | 150 | 200 |
February 2024 | $46,000.00 | $9,200.00 | 190 | 160 | 320 |
March 2024 | $45,000.00 | $9,400.00 | 200 | 155 | 190 |
April 2024 | $48,000.00 | $9,600.00 | 210 | 165 | 100 |
May 2024 | $49,000.00 | $9,800.00 | 220 | 170 | 230 |
June 2024 | $52,000.00 | $9,600.00 | 210 | 160 | 300 |
July 2024 | $48,000.00 | $9,700.00 | 215 | 170 | 175 |
August 2024 | $50,000.00 | $9,800.00 | 225 | 180 | 190 |
September 2024 | $45,000.00 | $9,700.00 | 220 | 175 | 120 |
October 2024 | $46,000.00 | $10,000.00 | 230 | 190 | 160 |
November 2024 | $50,000.00 | $9,900.00 | 225 | 185 | 230 |
December 2024 | $47,000.00 | $10,200.00 | 240 | 200 | 145 |
The Grid supports displaying aggregates in its footer, group footer and group caption. The aggregate configurations can be provided by the aggregates property. Built-in aggregates: Sum Average Min Max Count TrueCount FalseCount Custom - Requires the customAggregate property to perform aggregation. The custom aggregate value can be accessed inside template using the key ${custom}. In this demo, the footerTemplate property is used to display four different aggregates (${Sum}, ${Average}, ${Max} and ${Min}) in the Grid footer. Each aggregate type is specified using the type and field properties accessed in the footerTemplate with its type name. The aggregate value will be formatted based on its format value (N2 or C2) before being displayed. The template expression should be provided inside ${...} the interpolation syntax. More information on the stacked header configuration can be found in this documentation section.