44 IgxPivotGridComponent ,
55 IPivotConfiguration ,
66 PivotAggregation ,
7- IgxPivotDateDimension
7+ IgxPivotDateDimension ,
8+ DisplayDensity
89} from 'igniteui-angular' ;
910import { HIERARCHICAL_SAMPLE_DATA } from '../shared/sample-data' ;
1011
@@ -41,6 +42,9 @@ export class IgxTotalSaleAggregate {
4142} )
4243export class PivotGridSampleComponent {
4344 @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 ;
4448
4549 public pivotConfigHierarchy : IPivotConfiguration = {
4650 columns : [
@@ -80,7 +84,7 @@ export class PivotGridSampleComponent {
8084 key : 'SUM' ,
8185 aggregator : IgxPivotNumericAggregate . sum ,
8286 label : 'Sum'
83- } ,
87+ } ,
8488 enabled : true ,
8589 styles : {
8690 upFont : ( rowData : any , columnKey : any ) : boolean => rowData [ columnKey ] > 300 ,
@@ -101,11 +105,11 @@ export class PivotGridSampleComponent {
101105 key : 'SUM' ,
102106 aggregator : IgxTotalSaleAggregate . totalSale ,
103107 label : 'Sum of Sale'
104- } , {
108+ } , {
105109 key : 'MIN' ,
106110 aggregator : IgxTotalSaleAggregate . totalMin ,
107111 label : 'Minimum of Sale'
108- } , {
112+ } , {
109113 key : 'MAX' ,
110114 aggregator : IgxTotalSaleAggregate . totalMax ,
111115 label : 'Maximum of Sale'
@@ -149,5 +153,10 @@ export class PivotGridSampleComponent {
149153 {
150154 ProductCategory : 'Clothing' , UnitPrice : 16.05 , SellerName : 'Walter' ,
151155 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+ }
153162}
0 commit comments