Référence de l’API

FBasePivotView

Cette page API est actuellement disponible en anglais. Les signatures et identifiants restent identiques dans toutes les langues.

Facade API object bound to one Base Pivot View.

Access

Access through:

Setup

Register @univerjs-pro/bases-dashboard or a preset that includes it. In plugin mode, import @univerjs-pro/bases-dashboard/facade. Additional methods below require their listed plugin packages. See Facade setup.

@univerjs-pro/bases-dashboard

FBasePivotView.calculate

Calculates the Pivot View, optionally applying Dashboard or caller-owned table filters.

TypeScript
calculate(filters?: Array<IFilterConfig | null>): Promise<IBasePivotCalculationResult>

Parameters

  • filters — Optional. Default: []. Additional Base table filters applied before Pivot calculation.

Returns

Engine Pivot layout result suitable for rendering or Chart adaptation.

Examples

TypeScript
const result = await pivotView.calculate()console.log(result.view.dataView)

Types: IBasePivotCalculationResult · Promise · Array · IFilterConfig

Package: @univerjs-pro/bases-dashboard · Type definitions

FBasePivotView.delete

Deletes this Pivot View through the command system.

TypeScript
delete(): boolean

Returns

Whether the command succeeded.

Examples

TypeScript
pivotView.delete()

Package: @univerjs-pro/bases-dashboard · Type definitions

FBasePivotView.getConfig

Returns a detached Pivot and Chart configuration snapshot.

TypeScript
getConfig(): IBasePivotViewConfig

Returns

Current Pivot View configuration.

Examples

TypeScript
const config = pivotView.getConfig()

Types: IBasePivotViewConfig

Package: @univerjs-pro/bases-dashboard · Type definitions

FBasePivotView.getId

Returns the stable Pivot View id.

TypeScript
getId(): string

Returns

Stable Pivot View id.

Examples

TypeScript
const viewId = pivotView.getId()

Package: @univerjs-pro/bases-dashboard · Type definitions

FBasePivotView.getName

Returns the human-readable Pivot View name.

TypeScript
getName(): string

Returns

Pivot View name.

Examples

TypeScript
const name = pivotView.getName()

Package: @univerjs-pro/bases-dashboard · Type definitions

FBasePivotView.getPermission

Returns the Pivot View object permission facade.

canEdit() combines the Base unit, parent Table, and Pivot View Edit points. Enabling the Pivot View does not override a read-only Base or Table.

TypeScript
getPermission(): FBaseObjectPermission

Returns

Permission facade for this Pivot View.

Examples

Make one Pivot View read-only and restore it

TypeScript
const base = univerAPI.getActiveBase()const table = base?.getTables()[0]const pivot = table ? base?.getPivotViews(table.getId())[0] : undefinedif (!pivot) throw new Error('Pivot View not found.')await pivot.getPermission().setReadOnly()console.log(pivot.getPermission().canEdit()) // falseawait pivot.getPermission().setEditable()

Types: FBaseObjectPermission

Package: @univerjs-pro/bases-dashboard · Type definitions

FBasePivotView.getPivotTable

Creates a detached engine-pivot model initialized from this Pivot View.

Mutating the returned model does not change the Base. After using Engine methods such as addFieldWithSourceId(), persist the result with updateConfig({ pivot: pivotTable.toJSON() }).

TypeScript
getPivotTable(): PivotTable

Returns

Detached Engine Pivot model backed by the current table fields.

Examples

TypeScript
import { PivotTableFiledAreaEnum } from '@univerjs-pro/engine-pivot'const pivotTable = pivotView.getPivotTable()pivotTable.addFieldWithSourceId('region', PivotTableFiledAreaEnum.Row)pivotTable.addFieldWithSourceId('revenue', PivotTableFiledAreaEnum.Value)pivotView.updateConfig({ pivot: pivotTable.toJSON() })

Types: PivotTable

Package: @univerjs-pro/bases-dashboard · Type definitions

FBasePivotView.getSnapshot

Returns a detached Pivot View snapshot.

TypeScript
getSnapshot(): IBasePivotViewSnapshot

Returns

Snapshot safe for local inspection or editing.

Throws

If the Pivot View has been deleted or changed to another view type.

Examples

TypeScript
const snapshot = pivotView.getSnapshot()

Types: IBasePivotViewSnapshot

Package: @univerjs-pro/bases-dashboard · Type definitions

FBasePivotView.getTableId

Returns the stable source table id.

TypeScript
getTableId(): string

Returns

Stable source table id.

Examples

TypeScript
const tableId = pivotView.getTableId()

Package: @univerjs-pro/bases-dashboard · Type definitions

FBasePivotView.setName

Renames the Pivot View through the command system.

TypeScript
setName(name: string): boolean

Parameters

  • name — Required. New human-readable Pivot View name.

Returns

Whether the command succeeded.

Examples

TypeScript
pivotView.setName('Revenue by market')

Package: @univerjs-pro/bases-dashboard · Type definitions

FBasePivotView.updateConfig

Partially updates the Pivot View through the command system, including undo and redo support.

Top-level properties are replaced. Merge nested chart properties with the current Chart config before passing them when only one Chart property should change.

TypeScript
updateConfig(patch: Partial<IBasePivotViewConfig>): boolean

Parameters

  • patch — Required. Top-level Pivot View configuration patch.

Returns

Whether the command succeeded.

Examples

TypeScript
import { ChartTypeBits } from '@univerjs-pro/engine-chart'const current = pivotView.getConfig()pivotView.updateConfig({  chart: { ...current.chart, type: ChartTypeBits.Line },  displayMode: 'chart',})

Types: Partial · IBasePivotViewConfig

Package: @univerjs-pro/bases-dashboard · Type definitions

Que pensez-vous de ce guide ?

© 2026 DreamNum Co., Ltd.