@univerjs-pro/sheets-pivot
Pivot table integration for Univer Sheets.
TypeScript
import { UniverSheetsPivotTablePlugin } from '@univerjs-pro/sheets-pivot'univer.registerPlugin(UniverSheetsPivotTablePlugin, {})Entry Points
- Facade:
@univerjs-pro/sheets-pivot/facade - Locale:
@univerjs-pro/sheets-pivot/locale/* - Worker:
UniverSheetsPivotTablePluginfrom@univerjs-pro/sheets-pivot/worker
Report filters
FPivotTable.setOptions({ allowMultipleFilters: true }) enables concurrent member, label/date, and value filter categories. getDateFilter(), setDateFilter(), and clearDateFilter() manage fixed date conditions, including whole-day comparison. See multiple filters and date conditions.
Worksheet copy integrations
The root entry exports helpers for plugins that participate in worksheet copying:
getOrCreatePivotSheetCopyPlan()creates or reuses a plan in the operation’s shared copy context. The plan includes copied entries, a PivotTable ID map, and a shared data-field remapping context.PIVOT_SHEET_COPY_CONTEXT_KEYidentifies that plan in the copy context.remapPivotReportDataFields()remaps a report’s collection and field configuration in place using the shared context. Pass the copied report data, not the original source report.IPivotSheetCopyPlan,IPivotSheetCopyPlanEntry,IPivotSheetCopyScope,IPivotSheetCopySource, andIPivotSheetDataFieldCopyContextdescribe these inputs and results.
Use one shared copy context per worksheet-copy operation so PivotTables and PivotCharts agree on the new IDs and source mappings.
IUniverSheetsPivotConfig
TypeScript
import type { DateSystem } from '@univerjs/core'export interface IUniverSheetsPivotConfig { notExecuteFormula?: boolean // When the user configures this property, // if there are cells containing data in the pivot table next view range, // they will be directly overwritten without popping up a dialog box for the user to select. defaultOverride?: boolean /** * Define the maximum number of items that can be displayed in a single pivot table field. The default value is 1000. */ maxLimitItemCount?: number /** Automatically group date fields added to rows or columns. Defaults to true. */ autoDateGroup?: boolean /** Date system used for date grouping. Defaults to DateSystem.Date1900. */ dateSystem?: DateSystem}How is this guide?