You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/en/components/grids/pivot-grid/overview.md
+92Lines changed: 92 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -570,6 +570,98 @@ Using above code will result in the following example which groups the Date uniq
570
570
571
571
`sample="/{PivotGridSample}/features", height="700", alt="{Platform} Pivot Grid Basic Features Example"`
572
572
573
+
### Auto generate configuration
574
+
The `autoGenerateConfig` property automatically generates dimensions and values based on the data source fields:
575
+
576
+
- Numeric Fields:
577
+
- Created as `PivotValue` using `PivotNumericAggregate.sum` aggregator.
578
+
- Added to the values collection and enabled by default.
579
+
580
+
- Non-Numeric Fields:
581
+
- Created as `PivotDimension`.
582
+
- Disabled by default.
583
+
- Added to the columns collection.
584
+
585
+
- Date Fields(only the first `date` field is enabled, the other `date` fields apply non-numeric fields rule):
586
+
- Created as `PivotDateDimension`
587
+
- Enabled by default
588
+
- added to the rows collection.
589
+
590
+
This feature allows developers to quickly create a pivot view without manually specifying dimensions and values. With a pivot selector next to the pivot grid, users can enable and reorder dimensions and values as needed.
591
+
592
+
### Pivot Value Calculation Keys
593
+
594
+
The Pivot grid provides a customization to the object keys fields it uses to do its pivot calculations.
595
+
A more detailed view of how they are used can be seen bellow in example data, where you can see already aggregated values:
All of these are stored in the **pivotKeys** property which is part of the `PivotConfiguration` and can be used to change the default pivot keys.
611
+
- **children** - Field that stores children for hierarchy building. It represents a map from grouped values and all the pivotGridRecords that are based on that value. It can be utilized in very specific scenarios, where there is a need to do something while creating the hierarchies. No need to change this for common usage.
612
+
- **records** - Field that stores reference to the original data records. Can be seen in the example from above - **AllProducts_records**. Avoid setting fields in the data with the same name as this property. If your data records has **records** property, you can specify different and unique value for it using the **pivotKeys**.
613
+
- **aggregations** - Field that stores aggregation values. It's applied while creating the hierarchies and also it should not be changed for common scenarios.
614
+
- **level** - Field that stores dimension level based on its hierarchy. Avoid setting fields in the data with the same name as this property. If your data records has **level** property, you can specify different and unique value for it using the **pivotKeys**.
615
+
- **columnDimensionSeparator** - Separator used when generating the unique column field values. It is the dash(**-**) from example value - **All-Bulgaria**.
616
+
- **rowDimensionSeparator** - Separator used when generating the unique row field values. It's used when creating the **records** and **level** field.
617
+
618
+
The default values are:
619
+
```typescript
620
+
{
621
+
aggregations: 'aggregations',
622
+
records: 'records',
623
+
children: 'children',
624
+
level: 'level',
625
+
rowDimensionSeparator: '_',
626
+
columnDimensionSeparator: '-'
627
+
};
628
+
```
629
+
630
+
```razor
631
+
@code {
632
+
{
633
+
aggregations: 'aggregations',
634
+
records: 'records',
635
+
children: 'children',
636
+
level: 'level',
637
+
rowDimensionSeparator: '_',
638
+
columnDimensionSeparator: '-'
639
+
};
640
+
}
641
+
```
642
+
643
+
> [!Note]
644
+
>Ifyouhavedatafieldvaluesthatcontainthedefaultkeys, make sure to change the separators that match to any other symbols that you are not currently using. Otherwise could lead to unexpected behavior in calculating and showing the aggregated values.
645
+
646
+
<!-- Blazor -->
647
+
When overriding the `PivotKeys` in Blazor, currently you will need to define all other keys, since assigning a new PivotKeys object, it replaces completely the default ones:
648
+
649
+
```razor
650
+
@code {
651
+
var pivotConfiguration = new IgbPivotConfiguration();
0 commit comments