API Reference

FWaterfallChartBuilder

Fluent, type-specific Builder for Waterfall Charts.

Inheritance

Extends FCartesianChartBuilder. Its inherited members are available on this object.

Example

Sheet

TypeScript
const fWorkbook = univerAPI.getActiveWorkbook()const fWorksheet = fWorkbook.getSheetByName('Sheet1')const chartInfo = fWorksheet  .newChart(univerAPI.Enum.ChartTypeString.Waterfall)  .setSource('A1:B8')  .setPointRoles([    { series: 0, dataPointIndex: 3, role: univerAPI.Enum.ChartWaterfallPointRole.Total },  ])  .setConnector(true)  .setStackType(univerAPI.Enum.ChartWaterfallStackTypeEnum.Arrangement)  .setUseSubtotal(true)  .setPositiveStyle(0, { color: '#16a34a' })  .setNegativeStyle(0, { color: '#dc2626' })  .setSubtotalStyle(0, { color: '#2563eb' })  .build()await fWorksheet.insertChart(chartInfo)

Doc

TypeScript
const fDocument = univerAPI.getActiveDocument()const chartInfo = fDocument  .newChart(univerAPI.Enum.ChartTypeString.Waterfall)  .setSource([    ['Stage', 'Change'],    ['Revenue', 300],    ['Costs', -180],    ['Profit', 120],  ])  .setPointRoles([    { series: 0, dataPointIndex: 2, role: univerAPI.Enum.ChartWaterfallPointRole.Total },  ])  .setConnector(true)  .setStackType(univerAPI.Enum.ChartWaterfallStackTypeEnum.Arrangement)  .setUseSubtotal(true)  .setPositiveStyle(0, { color: '#16a34a' })  .setNegativeStyle(0, { color: '#dc2626' })  .setSubtotalStyle(0, { color: '#2563eb' })  .build()await fDocument.insertChart(chartInfo)

Slide

TypeScript
const fPresentation = univerAPI.getActivePresentation()const fSlide = fPresentation.getSlideByIndex(0)const chartInfo = fSlide  .newChart(univerAPI.Enum.ChartTypeString.Waterfall)  .setSource([    ['Stage', 'Change'],    ['Revenue', 300],    ['Costs', -180],    ['Profit', 120],  ])  .setPointRoles([    { series: 0, dataPointIndex: 2, role: univerAPI.Enum.ChartWaterfallPointRole.Total },  ])  .setConnector(true)  .setStackType(univerAPI.Enum.ChartWaterfallStackTypeEnum.Arrangement)  .setUseSubtotal(true)  .setPositiveStyle(0, { color: '#16a34a' })  .setNegativeStyle(0, { color: '#dc2626' })  .setSubtotalStyle(0, { color: '#2563eb' })  .build()await fSlide.insertChart(chartInfo)

Board

TypeScript
const fBoard = univerAPI.getActiveBoard()const chartInfo = fBoard  .newChart(univerAPI.Enum.ChartTypeString.Waterfall)  .setSource([    ['Stage', 'Change'],    ['Revenue', 300],    ['Costs', -180],    ['Profit', 120],  ])  .setPointRoles([    { series: 0, dataPointIndex: 2, role: univerAPI.Enum.ChartWaterfallPointRole.Total },  ])  .setConnector(true)  .setStackType(univerAPI.Enum.ChartWaterfallStackTypeEnum.Arrangement)  .setUseSubtotal(true)  .setPositiveStyle(0, { color: '#16a34a' })  .setNegativeStyle(0, { color: '#dc2626' })  .setSubtotalStyle(0, { color: '#2563eb' })  .build()await fBoard.insertChart(chartInfo)

Setup

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

@univerjs-pro/engine-chart

FWaterfallChartBuilder.clearConnector

Clears connector configuration. With no persisted connector setting, the renderer does not draw connectors; call setConnector(true) to restore the default dashed connector.

Read the cleared value from builder.build().config.waterfall?.connector.

TypeScript
clearConnector(): this

Returns

This builder for chaining.

Examples

TypeScript
builder.clearConnector()const connector = builder.build().config.waterfall?.connector

Package: @univerjs-pro/engine-chart · Type definitions

FWaterfallChartBuilder.clearNegativeStyle

Clears the negative style configuration and returns this builder for chaining.

This method executes synchronously.

TypeScript
clearNegativeStyle(selector: ChartPublicSeriesSelector): this

Parameters

  • selector — Required. The target series selector.

Returns

This builder for chaining.

Examples

TypeScript
builder.clearNegativeStyle(0)const negative = builder.build().config.series[0]?.waterfallStyles?.negative

Types: ChartPublicSeriesSelector

Package: @univerjs-pro/engine-chart · Type definitions

FWaterfallChartBuilder.clearPositiveStyle

Clears the positive style configuration and returns this builder for chaining.

This method executes synchronously.

TypeScript
clearPositiveStyle(selector: ChartPublicSeriesSelector): this

Parameters

  • selector — Required. The target series selector.

Returns

This builder for chaining.

Examples

TypeScript
builder.clearPositiveStyle(0)const positive = builder.build().config.series[0]?.waterfallStyles?.positive

Types: ChartPublicSeriesSelector

Package: @univerjs-pro/engine-chart · Type definitions

FWaterfallChartBuilder.clearSubtotalStyle

Clears the subtotal style configuration and returns this builder for chaining.

This method executes synchronously.

TypeScript
clearSubtotalStyle(selector: ChartPublicSeriesSelector): this

Parameters

  • selector — Required. The target series selector.

Returns

This builder for chaining.

Examples

TypeScript
builder.clearSubtotalStyle(0)const subtotal = builder.build().config.series[0]?.waterfallStyles?.subtotal

Types: ChartPublicSeriesSelector

Package: @univerjs-pro/engine-chart · Type definitions

FWaterfallChartBuilder.resetStackType

Restores the stack type to Arrangement and returns this builder for chaining.

This method executes synchronously.

TypeScript
resetStackType(): this

Returns

This builder for chaining.

Examples

TypeScript
builder.resetStackType()

Package: @univerjs-pro/engine-chart · Type definitions

FWaterfallChartBuilder.resetUseSubtotal

Restores automatic subtotal generation to its default of true and returns this builder for chaining.

This method executes synchronously.

TypeScript
resetUseSubtotal(): this

Returns

This builder for chaining.

Examples

TypeScript
builder.resetUseSubtotal()

Package: @univerjs-pro/engine-chart · Type definitions

FWaterfallChartBuilder.setConnector

Enables, disables, or styles derived Waterfall connectors.

Passing true renders a 1 px dashed connector with full opacity, no endpoint symbols, and a neutral #8C8C8C base color that is adapted by the active light or dark theme. An object starts from those defaults and overrides only the supplied fields. Pass false to hide it.

Read the current value from builder.build().config.waterfall?.connector.

TypeScript
setConnector(value: boolean | IChartWaterfallConnectorStyleSpec): this

Parameters

  • value — Required. false disables, true enables the default dashed style, and an object enables style overrides.

Returns

This builder for chaining.

Examples

TypeScript
builder.setConnector(true)const connector = builder.build().config.waterfall?.connector

Types: IChartWaterfallConnectorStyleSpec

Package: @univerjs-pro/engine-chart · Type definitions

FWaterfallChartBuilder.setNegativeStyle

Sets the negative style configuration and returns this builder for chaining.

This method executes synchronously.

TypeScript
setNegativeStyle(selector: ChartPublicSeriesSelector, value: Omit<IChartSeriesPatch, 'selector'>): this

Parameters

  • selector — Required. The target series selector.
  • value — Required. The semantic value to record.

Returns

This builder for chaining.

Examples

TypeScript
builder.setNegativeStyle(0, { color: '#f5222d' })const negative = builder.build().config.series[0]?.waterfallStyles?.negative

Types: ChartPublicSeriesSelector · Omit · IChartSeriesPatch

Package: @univerjs-pro/engine-chart · Type definitions

FWaterfallChartBuilder.setPointRoles

Replaces all Waterfall point roles.

Duplicate series/point identities use the last input and read back in canonical order.

TypeScript
setPointRoles(roles: readonly IChartWaterfallPointRoleSpec[]): this

Parameters

  • roles — Required. The complete point-role collection.

Returns

This builder for chaining.

Examples

TypeScript
builder.setPointRoles([  { series: 0, dataPointIndex: 0, role: univerAPI.Enum.ChartWaterfallPointRole.Total },])const roles = builder.build().config.waterfall?.pointRoles

Types: IChartWaterfallPointRoleSpec

Package: @univerjs-pro/engine-chart · Type definitions

FWaterfallChartBuilder.setPositiveStyle

Sets the positive style configuration and returns this builder for chaining.

This method executes synchronously.

TypeScript
setPositiveStyle(selector: ChartPublicSeriesSelector, value: Omit<IChartSeriesPatch, 'selector'>): this

Parameters

  • selector — Required. The target series selector.
  • value — Required. The semantic value to record.

Returns

This builder for chaining.

Examples

TypeScript
builder.setPositiveStyle(0, { color: '#52c41a' })const positive = builder.build().config.series[0]?.waterfallStyles?.positive

Types: ChartPublicSeriesSelector · Omit · IChartSeriesPatch

Package: @univerjs-pro/engine-chart · Type definitions

FWaterfallChartBuilder.setStackType

Sets the stack type configuration and returns this builder for chaining.

This method executes synchronously.

TypeScript
setStackType(value: WaterfallStackTypeEnum): this

Parameters

  • value — Required. The semantic value to record.

Returns

This builder for chaining.

Examples

TypeScript
builder.setStackType(univerAPI.Enum.ChartWaterfallStackTypeEnum.Arrangement)

Types: WaterfallStackTypeEnum

Package: @univerjs-pro/engine-chart · Type definitions

FWaterfallChartBuilder.setSubtotalStyle

Sets the subtotal style configuration and returns this builder for chaining.

This method executes synchronously.

TypeScript
setSubtotalStyle(selector: ChartPublicSeriesSelector, value: Omit<IChartSeriesPatch, 'selector'>): this

Parameters

  • selector — Required. The target series selector.
  • value — Required. The semantic value to record.

Returns

This builder for chaining.

Examples

TypeScript
builder.setSubtotalStyle(0, { color: '#1677ff' })const subtotal = builder.build().config.series[0]?.waterfallStyles?.subtotal

Types: ChartPublicSeriesSelector · Omit · IChartSeriesPatch

Package: @univerjs-pro/engine-chart · Type definitions

FWaterfallChartBuilder.setUseSubtotal

Sets the use subtotal configuration and returns this builder for chaining.

This method executes synchronously.

TypeScript
setUseSubtotal(value: boolean): this

Parameters

  • value — Required. The semantic value to record.

Returns

This builder for chaining.

Examples

TypeScript
builder.setUseSubtotal(true)

Package: @univerjs-pro/engine-chart · Type definitions

How is this guide?

© 2026 DreamNum Co., Ltd.