PivotTable and PivotMatrix using Bun template
Bun template saves blank spaces when expanding rows in comparison to default template
PivotTable::create(array(
...
'template' => 'PivotTable-Bun',
...
));
dollar_sales - sum | dollar_sales - count | dollar_sales - avg |
2004
|
2005
|
Total
|
|||||||||||||||
Total
|
$189,951
|
64
|
$2,968
|
$69,365
|
24
|
$2,890
|
$259,315
|
88
|
$2,947
|
|||||||||
AV Stores, Co.
|
$99,984
|
35
|
$2,857
|
$0
|
0
|
$0
|
$99,984
|
35
|
$2,857
|
|||||||||
Vintage Cars
|
$38,187
|
14
|
$2,728
|
$0
|
0
|
$0
|
$38,187
|
14
|
$2,728
|
|||||||||
Classic Cars
|
$34,738
|
11
|
$3,158
|
$0
|
0
|
$0
|
$34,738
|
11
|
$3,158
|
|||||||||
Ships
|
$19,186
|
7
|
$2,741
|
$0
|
0
|
$0
|
$19,186
|
7
|
$2,741
|
|||||||||
Trains
|
$7,874
|
3
|
$2,625
|
$0
|
0
|
$0
|
$7,874
|
3
|
$2,625
|
|||||||||
Amica Models & Co.
|
$82,223
|
26
|
$3,162
|
$0
|
0
|
$0
|
$82,223
|
26
|
$3,162
|
|||||||||
Vintage Cars
|
$45,177
|
17
|
$2,657
|
$0
|
0
|
$0
|
$45,177
|
17
|
$2,657
|
|||||||||
Classic Cars
|
$26,424
|
4
|
$6,606
|
$0
|
0
|
$0
|
$26,424
|
4
|
$6,606
|
|||||||||
Ships
|
$6,251
|
3
|
$2,084
|
$0
|
0
|
$0
|
$6,251
|
3
|
$2,084
|
|||||||||
Trucks and Buses
|
$2,352
|
1
|
$2,352
|
$0
|
0
|
$0
|
$2,352
|
1
|
$2,352
|
|||||||||
Trains
|
$2,019
|
1
|
$2,019
|
$0
|
0
|
$0
|
$2,019
|
1
|
$2,019
|
|||||||||
Anna's Decorations, Ltd
|
$0
|
0
|
$0
|
$56,932
|
19
|
$2,996
|
$56,932
|
19
|
$2,996
|
|||||||||
Trucks and Buses
|
$0
|
0
|
$0
|
$27,397
|
9
|
$3,044
|
$27,397
|
9
|
$3,044
|
|||||||||
Classic Cars
|
$0
|
0
|
$0
|
$18,188
|
4
|
$4,547
|
$18,188
|
4
|
$4,547
|
|||||||||
Vintage Cars
|
$0
|
0
|
$0
|
$11,348
|
6
|
$1,891
|
$11,348
|
6
|
$1,891
|
|||||||||
Alpha Cognac
|
$0
|
0
|
$0
|
$12,432
|
5
|
$2,486
|
$12,432
|
5
|
$2,486
|
|||||||||
Ships
|
$0
|
0
|
$0
|
$12,432
|
5
|
$2,486
|
$12,432
|
5
|
$2,486
|
|||||||||
Atelier graphique
|
$7,743
|
3
|
$2,581
|
$0
|
0
|
$0
|
$7,743
|
3
|
$2,581
|
|||||||||
Motorcycles
|
$6,067
|
2
|
$3,033
|
$0
|
0
|
$0
|
$6,067
|
2
|
$3,033
|
|||||||||
Vintage Cars
|
$1,676
|
1
|
$1,676
|
$0
|
0
|
$0
|
$1,676
|
1
|
$1,676
|
|||||||||
PivotMatrix::create(array(
...
'template' => 'PivotMatrix-Bun',
...
));
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
dollar_sales - sum
dollar_sales - count
dollar_sales - avg
|
orderYear
orderQuarter
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
customerName
productLine
productName
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Page size: |
Description
This examples show how to use BunTemplate, a custom template for Pivot Table. Bun Template contains custom html layout, css to make Pivot save space when expading row. This is very useful when your pivot table contains many row levels.
For your information, The Bun Template can be used with both Pivot widget and PivotMatrix widget.