Interface PivotConfigIf<T>

What a pivot table shows: the row fields (grouped like a row grouping), the column fields (their values become columns) and the values (aggregated per row × column), plus subtotals and totals. Used by PivotFactory.createTableModel, pivotRows and TableApi.setPivotConfig.

Fields have the form of a row grouping level (RowGroupField): a property path, a function (e.g. the quarter of a date) or RowGroupFieldIf with label, format and order – groupBy of a row grouping works as rowFields.

Example

const config: PivotConfigIf<Sale> = {
rowFields: ["region", "produkt"],
columnFields: [{ value: "monat", order: "insertion" }], // Jan before Feb (order in the data)
values: ["umsatz"], // sum of umsatz
emptyText: "–"
};

Since

1.1.94

Type Parameters

  • T = any

    the row type

Hierarchy

Properties

columnFields?: RowGroupField<T>[]

The fields whose values become columns, top first. Several fields form a multi-row header. Default [] (totals only).

columnSubtotals?: boolean

A total column behind every column group (e.g. "2026 Total" behind its quarters); the group gets a toggle and, when collapsed, shows only its total. Default: true with two or more column fields.

emptyLabel?: string

The label of empty keys (null, undefined, "") – rows and columns. Default "(empty)".

emptyText?: string

The text of a cell without data (the value stays undefined, not 0). Default "".

expanded?: RowGroupExpanded<T>

Expanded row groups: true (default), false, open levels as a number (0 = all closed) or a function per group.

maxColumns?: number

The maximum number of column keys (of the lowest column level). More keys: the first ones are shown, a warning is logged and PivotResult.truncated is true – total column, subtotal columns and total row still count all rows. Default 1000.

rowFields: RowGroupField<T>[]

The row levels, top first. Several levels form a hierarchy with subtotals. An empty list shows one total row.

subtotals?: boolean

Show the aggregates in the group rows (subtotals). Default true.

totalColumn?: boolean | "fixed"

The total column(s) on the right: "fixed" (default, fixed on the right), true (last columns, scrolled) or false.

totalLabel?: string

The word for totals: header of the total column, label of the total row, suffix of subtotal columns. Default "Total".

totalRow?: boolean

The total row in the footer. Default true.

values: PivotValue<T>[]

The aggregated values (at least one): "umsatz" (sum) or PivotValueIf. With several values every column key gets one column per value.