4
4
IgxPivotGridComponent ,
5
5
IPivotConfiguration ,
6
6
PivotAggregation ,
7
- IgxPivotDateDimension
7
+ IgxPivotDateDimension ,
8
+ DisplayDensity
8
9
} from 'igniteui-angular' ;
9
10
import { HIERARCHICAL_SAMPLE_DATA } from '../shared/sample-data' ;
10
11
@@ -41,6 +42,9 @@ export class IgxTotalSaleAggregate {
41
42
} )
42
43
export class PivotGridSampleComponent {
43
44
@ViewChild ( 'grid1' , { static : true } ) public grid1 : IgxPivotGridComponent ;
45
+ public comfortable : DisplayDensity = DisplayDensity . comfortable ;
46
+ public cosy : DisplayDensity = DisplayDensity . cosy ;
47
+ public compact : DisplayDensity = DisplayDensity . compact ;
44
48
45
49
public pivotConfigHierarchy : IPivotConfiguration = {
46
50
columns : [
@@ -80,7 +84,7 @@ export class PivotGridSampleComponent {
80
84
key : 'SUM' ,
81
85
aggregator : IgxPivotNumericAggregate . sum ,
82
86
label : 'Sum'
83
- } ,
87
+ } ,
84
88
enabled : true ,
85
89
styles : {
86
90
upFont : ( rowData : any , columnKey : any ) : boolean => rowData [ columnKey ] > 300 ,
@@ -101,11 +105,11 @@ export class PivotGridSampleComponent {
101
105
key : 'SUM' ,
102
106
aggregator : IgxTotalSaleAggregate . totalSale ,
103
107
label : 'Sum of Sale'
104
- } , {
108
+ } , {
105
109
key : 'MIN' ,
106
110
aggregator : IgxTotalSaleAggregate . totalMin ,
107
111
label : 'Minimum of Sale'
108
- } , {
112
+ } , {
109
113
key : 'MAX' ,
110
114
aggregator : IgxTotalSaleAggregate . totalMax ,
111
115
label : 'Maximum of Sale'
@@ -149,5 +153,10 @@ export class PivotGridSampleComponent {
149
153
{
150
154
ProductCategory : 'Clothing' , UnitPrice : 16.05 , SellerName : 'Walter' ,
151
155
Country : 'Bulgaria' , City : 'Plovdiv' , Date : '02/19/2020' , UnitsSold : 492
152
- } ] ;
156
+ }
157
+ ] ;
158
+
159
+ public setDensity ( density : DisplayDensity ) {
160
+ this . grid1 . displayDensity = density ;
161
+ }
153
162
}
0 commit comments