API 参考

FSheetPivotChart

本 API 页面目前提供英文正文。代码签名与标识符不随界面语言变化。

A live PivotChart hosted by a worksheet.

The Chart visual and Drawing placement belong to this PivotChart. The effective Pivot report belongs either to this chart (range source) or to the referenced PivotTable (linked source). Linked PivotCharts therefore share field, filter, sort, Show Values As, and collapse changes.

Access

Access through:

Example

Create an owned PivotChart

TypeScript
import '@univerjs-pro/sheets-pivot-chart/facade'const fWorkbook = univerAPI.getActiveWorkbook()const fWorksheet = fWorkbook.getSheetByName('Sales')const info = fWorksheet  .newPivotChart(univerAPI.Enum.ChartTypeString.Column)  .setSource('A1:G100')  .setPosition('J2')  .setSize(640, 360)  .setTitle('Sales by region')  .build()const fPivotChart = await fWorksheet.insertPivotChart(info)const sourceFields = fPivotChart.getSourceFieldsInfo()await fPivotChart.addField(sourceFields[0].id, univerAPI.Enum.PivotTableFiledAreaEnum.Row, 0)await fPivotChart.addField(sourceFields[5].id, univerAPI.Enum.PivotTableFiledAreaEnum.Value, 0)

Link multiple PivotCharts to one PivotTable

TypeScript
import '@univerjs-pro/sheets-pivot-chart/facade'const fWorkbook = univerAPI.getActiveWorkbook()const fWorksheet = fWorkbook.getSheetByName('Dashboard')const fPivotTable = fWorkbook.getPivotTableById('pivot-table-1')if (!fWorksheet || !fPivotTable) throw new Error('Pivot source is unavailable.')const first = await fWorksheet.insertPivotChart(  fPivotTable.newChart(univerAPI.Enum.ChartTypeString.Column).setPosition('A1').build(),)const second = await fWorksheet.insertPivotChart(  fPivotTable.newChart(univerAPI.Enum.ChartTypeString.Line).setPosition('J1').build(),)const rowFieldId = first.getFieldIdsByArea(univerAPI.Enum.PivotTableFiledAreaEnum.Row)[0]await first.setLabelSort(rowFieldId, {  type: univerAPI.Enum.PivotDataFieldSortOperatorEnum.ascending,})console.log(second.getFieldsConfig()) // Reads the same PivotTable-owned report.

Configure Show Values As and a value filter

TypeScript
const rowFieldId = fPivotChart.getFieldIdsByArea(univerAPI.Enum.PivotTableFiledAreaEnum.Row)[0]const valueFieldId = fPivotChart.getFieldIdsByArea(univerAPI.Enum.PivotTableFiledAreaEnum.Value)[0]await fPivotChart.setShowDataAs(valueFieldId, {  type: univerAPI.Enum.PivotShowAsTypeEnum.percentOfGrandTotal,  baseFieldId: '',  baseItem: '',})await fPivotChart.setValueFilter(rowFieldId, {  operator: univerAPI.Enum.PivotFilterOperatorEnum.valueGreaterThan,  expected: 1000,  valueFieldId,})

Handle an unavailable linked PivotTable

TypeScript
if (fPivotChart.isLinkedToPivotTable() && !fPivotChart.getPivotTable()) {  // Report writes resolve to false until the same PivotTable ID becomes available again.  console.log(await fPivotChart.resetFields())  // Per-chart visual changes remain available.  fPivotChart.setTheme('default')}

Setup

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

@univerjs-pro/sheets-pivot-chart

FSheetPivotChart.addField

Adds one source field to a report area.

TypeScript
addField(dataFieldIdOrIndex: string | number, area: PivotTableFiledAreaEnum, index: number): Promise<boolean>

Parameters

  • dataFieldIdOrIndex — Required. A source-field identifier or zero-based source index.
  • area — Required. The target report area.
  • index — Required. The zero-based target index.

Returns

Whether the field was added.

Types: Promise · PivotTableFiledAreaEnum

Package: @univerjs-pro/sheets-pivot-chart · Type definitions

FSheetPivotChart.bringForward

Moves this PivotChart forward by one level.

TypeScript
bringForward(): this

Returns

This PivotChart for chaining.

Package: @univerjs-pro/sheets-pivot-chart · Type definitions

FSheetPivotChart.bringToFront

Moves this PivotChart to the front.

TypeScript
bringToFront(): this

Returns

This PivotChart for chaining.

Package: @univerjs-pro/sheets-pivot-chart · Type definitions

FSheetPivotChart.clearAppearance

Clears all or one common Chart appearance property.

TypeScript
clearAppearance(target?: ChartAppearanceTarget): this

Parameters

  • target — Optional. The property to clear; omit it to clear all appearance overrides.

Returns

This PivotChart for chaining.

Types: ChartAppearanceTarget

Package: @univerjs-pro/sheets-pivot-chart · Type definitions

FSheetPivotChart.clearLabelSort

Clears label sorting for a row or column field.

TypeScript
clearLabelSort(fieldId: string): Promise<boolean>

Parameters

  • fieldId — Required. The row or column table-field identifier.

Returns

Whether sorting was cleared.

Types: Promise

Package: @univerjs-pro/sheets-pivot-chart · Type definitions

FSheetPivotChart.clearLegend

Clears the Chart legend.

TypeScript
clearLegend(): this

Returns

This PivotChart for chaining.

Package: @univerjs-pro/sheets-pivot-chart · Type definitions

FSheetPivotChart.clearPalette

Clears the explicit series palette.

TypeScript
clearPalette(): this

Returns

This PivotChart for chaining.

Package: @univerjs-pro/sheets-pivot-chart · Type definitions

FSheetPivotChart.clearSubtitle

Clears the Chart subtitle.

TypeScript
clearSubtitle(): this

Returns

This PivotChart for chaining.

Package: @univerjs-pro/sheets-pivot-chart · Type definitions

FSheetPivotChart.clearTheme

Clears the Chart theme.

TypeScript
clearTheme(): this

Returns

This PivotChart for chaining.

Package: @univerjs-pro/sheets-pivot-chart · Type definitions

FSheetPivotChart.clearTitle

Clears the Chart title.

TypeScript
clearTitle(): this

Returns

This PivotChart for chaining.

Package: @univerjs-pro/sheets-pivot-chart · Type definitions

FSheetPivotChart.clearValueFilter

Removes the value filter owned by a row or column field.

TypeScript
clearValueFilter(fieldId: string): Promise<boolean>

Parameters

  • fieldId — Required. The row or column table-field identifier.

Returns

Whether the value filter was removed.

Types: Promise

Package: @univerjs-pro/sheets-pivot-chart · Type definitions

FSheetPivotChart.getControls

Returns resolved PivotChart button visibility controls.

TypeScript
getControls(): DeepReadonly<IPivotChartControls>

Returns

A defensive resolved controls snapshot.

Types: IPivotChartControls · DeepReadonly

Package: @univerjs-pro/sheets-pivot-chart · Type definitions

FSheetPivotChart.getFieldIdsByArea

Returns table-field identifiers in one report area.

TypeScript
getFieldIdsByArea(area: PivotTableFiledAreaEnum): string[]

Parameters

  • area — Required. The Pivot report area.

Returns

Table-field identifiers in display order.

Types: PivotTableFiledAreaEnum

Package: @univerjs-pro/sheets-pivot-chart · Type definitions

FSheetPivotChart.getFieldsConfig

Returns the current effective report fields configuration.

TypeScript
getFieldsConfig(): DeepReadonly<IPivotTableSnapshot> | undefined

Returns

A defensive report snapshot, if available.

Types: DeepReadonly · IPivotTableSnapshot

Package: @univerjs-pro/sheets-pivot-chart · Type definitions

FSheetPivotChart.getFieldSetting

Returns one report field setting.

TypeScript
getFieldSetting(fieldId: string): IPivotTableValueFieldJSON | IPivotTableLabelFieldJSON | undefined

Parameters

  • fieldId — Required. The table-field identifier.

Returns

A defensive field snapshot.

Types: IPivotTableValueFieldJSON · IPivotTableLabelFieldJSON

Package: @univerjs-pro/sheets-pivot-chart · Type definitions

FSheetPivotChart.getId

Returns the stable identifier of this PivotChart.

TypeScript
getId(): string

Returns

The PivotChart identifier.

Package: @univerjs-pro/sheets-pivot-chart · Type definitions

FSheetPivotChart.getInfo

Returns detached information that can be inspected, copied, or passed to update.

TypeScript
getInfo(): DeepReadonly<ISheetPivotChartInfo>

Returns

A defensive PivotChart snapshot.

Types: ISheetPivotChartInfo · DeepReadonly

Package: @univerjs-pro/sheets-pivot-chart · Type definitions

FSheetPivotChart.getPivotTable

Returns a live facade for the referenced PivotTable.

TypeScript
getPivotTable(): FPivotTable | null

Returns

The shared PivotTable, or null while the reference is unavailable.

Types: FPivotTable

Package: @univerjs-pro/sheets-pivot-chart · Type definitions

FSheetPivotChart.getPivotTableReference

Returns the stable linked PivotTable reference.

TypeScript
getPivotTableReference(): DeepReadonly<IPivotChartPivotTableReference> | undefined

Returns

The reference for linked charts.

Types: DeepReadonly · IPivotChartPivotTableReference

Package: @univerjs-pro/sheets-pivot-chart · Type definitions

FSheetPivotChart.getShowDataAs

Returns the Show Values As rule for a value field.

TypeScript
getShowDataAs(fieldId: string): IPivotTableShowDataAsInfo | undefined

Parameters

  • fieldId — Required. The value table-field identifier.

Returns

A defensive rule snapshot.

Types: IPivotTableShowDataAsInfo

Package: @univerjs-pro/sheets-pivot-chart · Type definitions

FSheetPivotChart.getSourceFieldsInfo

Returns source fields available to the effective Pivot report.

TypeScript
getSourceFieldsInfo(): IPivotChartDataFieldInfo[]

Returns

Defensive field information in source order.

Types: IPivotChartDataFieldInfo

Package: @univerjs-pro/sheets-pivot-chart · Type definitions

FSheetPivotChart.getSourceKind

Returns whether this PivotChart owns a range report or references a PivotTable.

TypeScript
getSourceKind(): PivotChartSourceKind

Returns

The current source ownership kind.

Types: PivotChartSourceKind

Package: @univerjs-pro/sheets-pivot-chart · Type definitions

FSheetPivotChart.getSourceRangeInfo

Returns the effective source range for owned and available linked reports.

TypeScript
getSourceRangeInfo(): IUnitRangeNameWithSubUnitId | undefined

Returns

A defensive range snapshot, if available.

Types: IUnitRangeNameWithSubUnitId

Package: @univerjs-pro/sheets-pivot-chart · Type definitions

FSheetPivotChart.getType

Returns the current PivotChart type.

TypeScript
getType(): PivotChartTypeString

Returns

The supported Chart type.

Types: PivotChartTypeString

Package: @univerjs-pro/sheets-pivot-chart · Type definitions

FSheetPivotChart.getValueFilter

Returns the value filter owned by a row or column field.

TypeScript
getValueFilter(fieldId: string): IPivotTableValueFilter | undefined

Parameters

  • fieldId — Required. The row or column table-field identifier.

Returns

A defensive filter snapshot.

Types: IPivotTableValueFilter

Package: @univerjs-pro/sheets-pivot-chart · Type definitions

FSheetPivotChart.getValueFilters

Returns value filters in evaluation order.

TypeScript
getValueFilters(): IValueFilterInfoItem[]

Returns

Defensive ordered filter snapshots.

Types: IValueFilterInfoItem

Package: @univerjs-pro/sheets-pivot-chart · Type definitions

FSheetPivotChart.isLinkedToPivotTable

Returns whether this PivotChart shares a PivotTable-owned report.

TypeScript
isLinkedToPivotTable(): boolean

Returns

true for a linked PivotChart.

Package: @univerjs-pro/sheets-pivot-chart · Type definitions

FSheetPivotChart.pivotChartId

The stable identifier of this PivotChart.

TypeScript
readonly pivotChartId: string

Package: @univerjs-pro/sheets-pivot-chart · Type definitions

FSheetPivotChart.remove

Removes this PivotChart and its worksheet Drawing.

TypeScript
remove(): Promise<boolean>

Returns

Whether the removal was accepted.

Types: Promise

Package: @univerjs-pro/sheets-pivot-chart · Type definitions

FSheetPivotChart.removeField

Removes report fields by their table-field identifiers.

TypeScript
removeField(fieldIds: string[]): Promise<boolean>

Parameters

  • fieldIds — Required. The table-field identifiers to remove together.

Returns

Whether the fields were removed.

Types: Promise

Package: @univerjs-pro/sheets-pivot-chart · Type definitions

FSheetPivotChart.renameField

Renames a report field.

TypeScript
renameField(fieldId: string, name: string): Promise<boolean>

Parameters

  • fieldId — Required. The table-field identifier.
  • name — Required. The new display name.

Returns

Whether the field was renamed.

Types: Promise

Package: @univerjs-pro/sheets-pivot-chart · Type definitions

FSheetPivotChart.resetAutoGradientFill

Restores the default automatic-gradient behavior.

TypeScript
resetAutoGradientFill(): this

Returns

This PivotChart for chaining.

Package: @univerjs-pro/sheets-pivot-chart · Type definitions

FSheetPivotChart.resetFields

Removes all fields or only fields in one report area.

TypeScript
resetFields(area?: PivotTableFiledAreaEnum): Promise<boolean>

Parameters

  • area — Optional. The area to clear; omit it to clear all report fields.

Returns

Whether the report update was accepted.

Types: Promise · PivotTableFiledAreaEnum

Package: @univerjs-pro/sheets-pivot-chart · Type definitions

FSheetPivotChart.resetInvalidValueStrategy

Restores the default invalid-value strategy.

TypeScript
resetInvalidValueStrategy(): this

Returns

This PivotChart for chaining.

Package: @univerjs-pro/sheets-pivot-chart · Type definitions

FSheetPivotChart.resetShowDataAs

Restores normal value display for a value field.

TypeScript
resetShowDataAs(fieldId: string): Promise<boolean>

Parameters

  • fieldId — Required. The value table-field identifier.

Returns

Whether the rule was reset.

Types: Promise

Package: @univerjs-pro/sheets-pivot-chart · Type definitions

FSheetPivotChart.sendBackward

Moves this PivotChart backward by one level.

TypeScript
sendBackward(): this

Returns

This PivotChart for chaining.

Package: @univerjs-pro/sheets-pivot-chart · Type definitions

FSheetPivotChart.sendToBack

Moves this PivotChart to the back.

TypeScript
sendToBack(): this

Returns

This PivotChart for chaining.

Package: @univerjs-pro/sheets-pivot-chart · Type definitions

FSheetPivotChart.setAbsolutePosition

Sets the absolute worksheet Drawing position.

TypeScript
setAbsolutePosition(x: number, y: number): this

Parameters

  • x — Required. The horizontal position in pixels.
  • y — Required. The vertical position in pixels.

Returns

This PivotChart for chaining.

Package: @univerjs-pro/sheets-pivot-chart · Type definitions

FSheetPivotChart.setAppearance

Sets common Chart appearance.

TypeScript
setAppearance(value: IChartAppearanceSpec): this

Parameters

  • value — Required. The appearance overrides.

Returns

This PivotChart for chaining.

Types: IChartAppearanceSpec

Package: @univerjs-pro/sheets-pivot-chart · Type definitions

FSheetPivotChart.setAutoGradientFill

Enables or disables automatic gradient fill.

TypeScript
setAutoGradientFill(value: boolean): this

Parameters

  • value — Required. Whether automatic gradients are enabled.

Returns

This PivotChart for chaining.

Package: @univerjs-pro/sheets-pivot-chart · Type definitions

FSheetPivotChart.setCategoryLevel

Expands the category hierarchy through the requested row field.

TypeScript
setCategoryLevel(fieldId: string): Promise<boolean>

Parameters

  • fieldId — Required. The deepest row table-field identifier to display.

Returns

Whether the category level was updated.

Types: Promise

Package: @univerjs-pro/sheets-pivot-chart · Type definitions

FSheetPivotChart.setCollapse

Collapses or expands a row hierarchy field or one item.

TypeScript
setCollapse(fieldId: string, collapse: boolean, item?: string): Promise<boolean>

Parameters

  • fieldId — Required. The row table-field identifier.
  • collapse — Required. Whether to collapse the target.
  • item — Optional. An optional item key; omit it to target the whole field.

Returns

Whether the hierarchy state was updated.

Types: Promise

Package: @univerjs-pro/sheets-pivot-chart · Type definitions

FSheetPivotChart.setControls

Merges PivotChart button visibility controls.

TypeScript
setControls(controls: Partial<IPivotChartControls>): this

Parameters

  • controls — Required. The controls to override.

Returns

This PivotChart for chaining.

Types: Partial · IPivotChartControls

Package: @univerjs-pro/sheets-pivot-chart · Type definitions

FSheetPivotChart.setDateGroupType

Groups a row or column date field using a Pivot date interval.

TypeScript
setDateGroupType(fieldId: string, dateType: PivotDateGroupFieldDateTypeEnum): Promise<boolean>

Parameters

  • fieldId — Required. The source date or existing date-group table-field identifier.
  • dateType — Required. The requested date interval.

Returns

Whether the date group was updated.

Types: Promise · PivotDateGroupFieldDateTypeEnum

Package: @univerjs-pro/sheets-pivot-chart · Type definitions

FSheetPivotChart.setExpandCollapseButtonsVisible

Shows or hides category hierarchy expand and collapse buttons.

TypeScript
setExpandCollapseButtonsVisible(visible: boolean): this

Parameters

  • visible — Required. Whether expand and collapse buttons are visible.

Returns

This PivotChart for chaining.

Package: @univerjs-pro/sheets-pivot-chart · Type definitions

FSheetPivotChart.setFieldButtonsVisible

Shows or hides all Pivot field buttons.

TypeScript
setFieldButtonsVisible(visible: boolean): this

Parameters

  • visible — Required. Whether field buttons are visible.

Returns

This PivotChart for chaining.

Package: @univerjs-pro/sheets-pivot-chart · Type definitions

FSheetPivotChart.setFieldsConfig

Replaces all report fields in one command and one Pivot query.

TypeScript
setFieldsConfig(config: IPivotTableSnapshot): Promise<boolean>

Parameters

  • config — Required. The complete fields configuration.

Returns

Whether the report update was accepted.

Types: Promise · IPivotTableSnapshot

Package: @univerjs-pro/sheets-pivot-chart · Type definitions

FSheetPivotChart.setFieldSetting

Updates a report field display name, format, aggregation, or Show Values As rule.

TypeScript
setFieldSetting(fieldId: string, setting: IPivotChartFieldSettingOptions): Promise<boolean>

Parameters

  • fieldId — Required. The table-field identifier.
  • setting — Required. The field properties to update together.

Returns

Whether the field setting was updated.

Types: Promise · IPivotChartFieldSettingOptions

Package: @univerjs-pro/sheets-pivot-chart · Type definitions

FSheetPivotChart.setInvalidValueStrategy

Sets how invalid Pivot values are rendered.

TypeScript
setInvalidValueStrategy(value: InvalidValueType): this

Parameters

  • value — Required. The invalid-value strategy.

Returns

This PivotChart for chaining.

Types: InvalidValueType

Package: @univerjs-pro/sheets-pivot-chart · Type definitions

FSheetPivotChart.setLabelManualFilter

Sets a manual label filter for a report field.

TypeScript
setLabelManualFilter(fieldId: string, items: string[], isAll?: boolean): Promise<boolean>

Parameters

  • fieldId — Required. The table-field identifier.
  • items — Required. The selected item keys.
  • isAll — Optional. Whether all current items are selected.

Returns

Whether the filter was updated.

Types: Promise

Package: @univerjs-pro/sheets-pivot-chart · Type definitions

FSheetPivotChart.setLabelSort

Sets label sorting for a row or column field.

TypeScript
setLabelSort(fieldId: string, info: IPivotTableSortInfo): Promise<boolean>

Parameters

  • fieldId — Required. The row or column table-field identifier.
  • info — Required. The sort rule.

Returns

Whether sorting was updated.

Types: Promise · IPivotTableSortInfo

Package: @univerjs-pro/sheets-pivot-chart · Type definitions

FSheetPivotChart.setLegend

Sets the Chart legend.

TypeScript
setLegend(value: ChartLegendSpec): this

Parameters

  • value — Required. The legend specification.

Returns

This PivotChart for chaining.

Types: ChartLegendSpec

Package: @univerjs-pro/sheets-pivot-chart · Type definitions

FSheetPivotChart.setPalette

Sets an explicit series palette.

TypeScript
setPalette(colors: readonly string[]): this

Parameters

  • colors — Required. The series colors.

Returns

This PivotChart for chaining.

Package: @univerjs-pro/sheets-pivot-chart · Type definitions

FSheetPivotChart.setPosition

Sets the worksheet cell anchor of this PivotChart.

TypeScript
setPosition(anchor: ChartAnchorSpec): this

Parameters

  • anchor — Required. A1 notation or a zero-based row and column anchor.

Returns

This PivotChart for chaining.

Types: ChartAnchorSpec

Package: @univerjs-pro/sheets-pivot-chart · Type definitions

FSheetPivotChart.setShowDataAs

Sets the Show Values As rule for a value field.

TypeScript
setShowDataAs(fieldId: string, value: IPivotTableShowDataAsInfo): Promise<boolean>

Parameters

  • fieldId — Required. The value table-field identifier.
  • value — Required. The Show Values As rule.

Returns

Whether the rule was updated.

Types: Promise · IPivotTableShowDataAsInfo

Package: @univerjs-pro/sheets-pivot-chart · Type definitions

FSheetPivotChart.setSize

Sets the worksheet Drawing size.

TypeScript
setSize(width: number, height: number): this

Parameters

  • width — Required. The width in pixels.
  • height — Required. The height in pixels.

Returns

This PivotChart for chaining.

Package: @univerjs-pro/sheets-pivot-chart · Type definitions

FSheetPivotChart.setSourceRange

Updates the effective report source without changing its ownership mode.

Linked PivotCharts delegate this operation to their referenced PivotTable.

TypeScript
setSourceRange(source: IUnitRangeNameWithSubUnitId): Promise<boolean>

Parameters

  • source — Required. The complete source range identity.

Returns

Whether the source update was accepted.

Types: Promise · IUnitRangeNameWithSubUnitId

Package: @univerjs-pro/sheets-pivot-chart · Type definitions

FSheetPivotChart.setSubtitle

Sets the Chart subtitle.

TypeScript
setSubtitle(value: ChartSubtitleSpec): this

Parameters

  • value — Required. The subtitle specification.

Returns

This PivotChart for chaining.

Types: ChartSubtitleSpec

Package: @univerjs-pro/sheets-pivot-chart · Type definitions

FSheetPivotChart.setTheme

Sets the Chart theme.

TypeScript
setTheme(name: string): this

Parameters

  • name — Required. The registered theme name.

Returns

This PivotChart for chaining.

Package: @univerjs-pro/sheets-pivot-chart · Type definitions

FSheetPivotChart.setTitle

Sets the Chart title.

TypeScript
setTitle(value: ChartTitleSpec): this

Parameters

  • value — Required. The title specification.

Returns

This PivotChart for chaining.

Types: ChartTitleSpec

Package: @univerjs-pro/sheets-pivot-chart · Type definitions

FSheetPivotChart.setType

Sets the current supported Chart type.

TypeScript
setType(type: PivotChartTypeString): this

Parameters

  • type — Required. The target supported type.

Returns

This PivotChart for chaining.

Throws

If the type is not supported by PivotChart.

Types: PivotChartTypeString

Package: @univerjs-pro/sheets-pivot-chart · Type definitions

FSheetPivotChart.setValueFilter

Sets, replaces, or removes the value filter owned by a row or column field.

TypeScript
setValueFilter(fieldId: string, filter?: Omit<IPivotTableValueFilter, 'type'>): Promise<boolean>

Parameters

  • fieldId — Required. The row or column table-field identifier.
  • filter — Optional. The rule, or undefined to remove it.

Returns

Whether the value filter was updated.

Types: Promise · Omit · IPivotTableValueFilter

Package: @univerjs-pro/sheets-pivot-chart · Type definitions

FSheetPivotChart.setZOrder

Moves this PivotChart to a zero-based Drawing order index.

TypeScript
setZOrder(index: number): this

Parameters

  • index — Required. The target zero-based z-order index.

Returns

This PivotChart for chaining.

Package: @univerjs-pro/sheets-pivot-chart · Type definitions

FSheetPivotChart.subUnitId

The worksheet identifier that hosts this PivotChart.

TypeScript
readonly subUnitId: string

Package: @univerjs-pro/sheets-pivot-chart · Type definitions

FSheetPivotChart.toBuilder

Creates a detached, source-locked Builder prefilled from this PivotChart.

TypeScript
toBuilder(): FBoundSheetPivotChartBuilderOf<PivotChartTypeString>toBuilder<T extends PivotChartTypeString>(type: T): FBoundSheetPivotChartBuilderOf<T>

Parameters

  • type — Optional. The target supported Chart type.

Returns

A source-locked Builder.

A source-locked Builder for the target type.

Types: PivotChartTypeString · FBoundSheetPivotChartBuilderOf

Package: @univerjs-pro/sheets-pivot-chart · Type definitions

FSheetPivotChart.unitId

The workbook identifier that owns this PivotChart.

TypeScript
readonly unitId: string

Package: @univerjs-pro/sheets-pivot-chart · Type definitions

FSheetPivotChart.update

Atomically updates visual configuration, controls, name, and placement.

The source mode, source identity, and live PivotModel are locked. Use setSourceRange or the field APIs for report changes.

TypeScript
update(info: ISheetPivotChartInfo): Promise<this>

Parameters

  • info — Required. Detached information created by getInfo or toBuilder.

Returns

This live PivotChart after the command is accepted.

Throws

If the source, report fields, Chart type, or Drawing layout is invalid.

Types: Promise · ISheetPivotChartInfo

Package: @univerjs-pro/sheets-pivot-chart · Type definitions

FSheetPivotChart.updateFieldPosition

Moves one report field to a zero-based area index.

TypeScript
updateFieldPosition(fieldId: string, area: PivotTableFiledAreaEnum, index: number): Promise<boolean>

Parameters

  • fieldId — Required. The table-field identifier.
  • area — Required. The target area.
  • index — Required. The zero-based target index.

Returns

Whether the field was moved.

Types: Promise · PivotTableFiledAreaEnum

Package: @univerjs-pro/sheets-pivot-chart · Type definitions

FSheetPivotChart.updateValuePosition

Moves the synthetic multiple-values field.

TypeScript
updateValuePosition(position: PivotTableValuePositionEnum, index: number): Promise<boolean>

Parameters

  • position — Required. The row, column, or absent position.
  • index — Required. The zero-based row or column field index.

Returns

Whether the value position was updated.

Types: Promise · PivotTableValuePositionEnum

Package: @univerjs-pro/sheets-pivot-chart · Type definitions

你觉得这篇文档如何?

© 2026 DreamNum Co., Ltd.