the row type
Groups the rows by the row and column fields and aggregates the values. Use pivotRows.
fields and values
Optional accept: ((sourceIndex) => boolean)a filter: only rows it accepts count
Readonly columnThe column groups of the top level (with sub-groups); empty without column fields.
Readonly columnThe shown column keys of the lowest level in display order – at most PivotConfigIf.maxColumns.
Readonly rowThe row groups of the top level (with sub-groups); empty without row fields.
Readonly truncatedTrue if there were more column keys than PivotConfigIf.maxColumns (the rest is not shown as columns).
Readonly valuesThe values (name, label, aggregator, format).
Computes all cells again (same keys) – after a filter change or changed values.
Optional accept: ((sourceIndex) => boolean)a filter: only rows it accepts count
result.compute(i => sales[i].monat === "Jan");
result.getValue(); // 230
The number of rows of a cell, a subtotal or a total (after the filter).
Optional row: RowGroupIf<T>a row group; undefined = all rows
Optional column: RowGroupIf<T>a column key or group; undefined = all columns
the row count, 0 for a combination without rows
result.getCount(result.rowGroups[0]); // 3 – the rows of Nord
The rows behind a cell (drill-down), after the filter, in source order.
Optional row: RowGroupIf<T>a row group; undefined = all rows
Optional column: RowGroupIf<T>a column key or group; undefined = all columns
a new array
result.getSourceRows(nord, jan).map(s => s.umsatz); // [100, 50]
The aggregated value of a cell, a subtotal or a total.
Optional row: RowGroupIf<T>a row group (any level); undefined = all rows (column totals)
Optional column: RowGroupIf<T>a column key or column group (any level); undefined = all columns (row totals)
Optional value: string | number = 0the index or name of the value
the result, undefined if no row has this combination
result.getValue(result.rowGroups[0], undefined, "sum(umsatz)"); // the total of the first row group
True if a column group is shown – false for groups whose keys were all cut off by maxColumns.
a column group
true if it has at least one shown column key
The result of a pivot (pivotRows, AreaModelPivot.getResult): the row and column hierarchies and the aggregated value of every combination – cells, subtotals and totals. DOM-free; the table reads its cells from here.
getValue(row, column)– a cell; leave outrowfor the column total,columnfor the row total, both for the grand total. Groups of higher levels give subtotals.undefined(not 0).first/lastonly: a row total adds its rows in source order, a column group merges its keys in key order, so the two may differ. Keys cut off bymaxColumnsstill count in subtotals and totals.Example
Since
1.1.94