API Reference

FCartesianChartBuilder

Fluent Builder for Cartesian Charts with per-series styling and trendlines.

Inheritance

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

Example

TypeScript
const fWorkbook = univerAPI.getActiveWorkbook()const fWorksheet = fWorkbook.getSheetByName('Sheet1')const chartInfo = fWorksheet  .newChart(univerAPI.Enum.ChartTypeString.Column)  .setSource('A1:D8')  .setBar({ gapWidth: 0.2 })  .build()await fWorksheet.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

FCartesianChartBuilder.clearAllSeriesOverrides

Clears every per-series override while preserving all-series defaults. Use setSeries() to write one selector and describe().series to read the effective state.

TypeScript
clearAllSeriesOverrides(): this

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

FCartesianChartBuilder.clearAllSeriesStyle

Clears persistent defaults inherited by every series.

This method executes synchronously.

TypeScript
clearAllSeriesStyle(target?: ChartAllSeriesStyleTarget): this

Parameters

  • target — Optional. The global series style field to clear, or omit it to clear all defaults.

Returns

This builder for chaining.

Examples

TypeScript
builder.clearAllSeriesStyle(univerAPI.Enum.ChartAllSeriesStyleTarget.Color)

Types: ChartAllSeriesStyleTarget

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

FCartesianChartBuilder.clearAxisPointer

Clears the axis pointer configuration and returns this builder for chaining.

This method executes synchronously.

TypeScript
clearAxisPointer(target?: ChartAxisPointerTarget): this

Parameters

  • target — Optional. The configuration field to clear or reset.

Returns

This builder for chaining.

Examples

TypeScript
builder.clearAxisPointer(univerAPI.Enum.ChartAxisPointerTarget.IndicatorLineColor)

Types: ChartAxisPointerTarget

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

FCartesianChartBuilder.clearBar

Clears Chart-wide Bar and Column layout overrides.

TypeScript
clearBar(): this

Returns

This Builder for chaining.

Examples

builder.clearBar()

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

FCartesianChartBuilder.clearSeries

Clears the series configuration and returns this builder for chaining.

This method executes synchronously.

TypeScript
clearSeries(selector: ChartPublicSeriesSelector, target?: ChartSeriesClearTarget): this

Parameters

  • selector — Required. The target series selector.
  • target — Optional. The configuration field to clear or reset.

Returns

This builder for chaining.

Examples

TypeScript
builder.clearSeries(0)

Types: ChartPublicSeriesSelector · ChartSeriesClearTarget

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

FCartesianChartBuilder.clearTrendlines

Clears the trendlines configuration and returns this builder for chaining.

This method executes synchronously.

TypeScript
clearTrendlines(selector?: ChartSeriesTrendlineSelector): this

Parameters

  • selector — Optional. The target series selector.

Returns

This builder for chaining.

Examples

TypeScript
builder.clearTrendlines(0)

Types: ChartSeriesTrendlineSelector

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

FCartesianChartBuilder.removeTrendline

Remove trendline.

This method executes synchronously.

TypeScript
removeTrendline(selector: ChartSeriesTrendlineSelector, trendline: ChartTrendlineSelector): this

Parameters

  • selector — Required. The target series selector.
  • trendline — Required. The trendline configuration to append.

Returns

This builder for chaining.

Examples

TypeScript
builder.removeTrendline(0, 0)

Types: ChartSeriesTrendlineSelector · ChartTrendlineSelector

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

FCartesianChartBuilder.setAllSeriesStyle

Sets persistent defaults inherited by every current and future series.

This method executes synchronously.

TypeScript
setAllSeriesStyle(style: DeepNullish<TSeriesStyle>): this

Parameters

  • style — Required. The global series style defaults.

Returns

This builder for chaining.

Examples

TypeScript
builder.setAllSeriesStyle({ color: '#1677ff', fillOpacity: 0.8 })

Types: DeepNullish

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

FCartesianChartBuilder.setAxisPointer

Sets the axis pointer configuration and returns this builder for chaining.

This method executes synchronously.

TypeScript
setAxisPointer(value: IChartAxisPointerSpec): this

Parameters

  • value — Required. The semantic value to record.

Returns

This builder for chaining.

Examples

TypeScript
builder.setAxisPointer({ indicatorLineColor: '#1677ff' })

Types: IChartAxisPointerSpec

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

FCartesianChartBuilder.setBar

Sets Chart-wide Bar and Column spacing and width options.

TypeScript
setBar(value: IChartBarSpec): this

Parameters

  • value — Required. The Bar or Column layout specification.

Returns

This Builder for chaining.

Types: IChartBarSpec

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

FCartesianChartBuilder.setSeries

Sets the series configuration and returns this builder for chaining.

This method executes synchronously.

TypeScript
setSeries(selector: ChartPublicSeriesSelector, patch: DeepNullish<TSeriesPatch>): this

Parameters

  • selector — Required. The target series selector.
  • patch — Required. The semantic configuration patch owned by this method.

Returns

This builder for chaining.

Examples

TypeScript
import { chartLinearGradient } from '@univerjs-pro/engine-chart'const color = chartLinearGradient({  start: { x: 0, y: 1 },  end: { x: 0, y: 0 },  stops: [    { offset: 0, color: 'rgba(22, 119, 255, 0)' },    { offset: 1, color: '#1677ff' },  ],})builder.setSeries(0, { color })

Types: ChartPublicSeriesSelector · DeepNullish

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

FCartesianChartBuilder.setTrendline

Sets the trendline configuration and returns this builder for chaining.

This method executes synchronously.

TypeScript
setTrendline(selector: ChartSeriesTrendlineSelector, value: ChartTrendlineValue): this

Parameters

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

Returns

This builder for chaining.

Examples

TypeScript
builder.setTrendline(0, { type: univerAPI.Enum.ChartTrendlineType.linear })

Types: ChartSeriesTrendlineSelector · ChartTrendlineValue

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

How is this guide?

© 2026 DreamNum Co., Ltd.