API Reference

FParetoChartBuilder

Fluent, type-specific Builder for Pareto Charts.

Select one category field with setCategoryField() and one numeric value field with setValueFields([index]). Field indexes are zero-based in the normalized data source. Explicit mapping is necessary when the source shape is ambiguous, such as a Sheet range containing only numeric values; without both roles, the Chart has no renderable series.

Rows with the same category are aggregated. By default, zero and negative totals are excluded, the remaining categories are sorted from largest to smallest, and the renderer derives the cumulative-percentage line from the selected value field. Use setIncludeZeroValues(true) to retain zero totals; negative totals remain excluded.

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.Pareto)  .setSource('A1:B8')  .setCategoryField(0)  .setValueFields([1])  .setBarStyle({ color: '#2563eb', opacity: 0.8 })  .setCumulativeLineStyle({ color: '#dc2626', width: 2 })  .setIncludeZeroValues(false)  .build()await fWorksheet.insertChart(chartInfo)

Doc

TypeScript
const fDocument = univerAPI.getActiveDocument()const chartInfo = fDocument  .newChart(univerAPI.Enum.ChartTypeString.Pareto)  .setSource([    ['Cause', 'Count'],    ['A', 42],    ['B', 28],    ['C', 15],  ])  .setCategoryField(0)  .setValueFields([1])  .setBarStyle({ color: '#2563eb', opacity: 0.8 })  .setCumulativeLineStyle({ color: '#dc2626', width: 2 })  .setIncludeZeroValues(false)  .build()await fDocument.insertChart(chartInfo)

Slide

TypeScript
const fPresentation = univerAPI.getActivePresentation()const fSlide = fPresentation.getSlideByIndex(0)const chartInfo = fSlide  .newChart(univerAPI.Enum.ChartTypeString.Pareto)  .setSource([    ['Cause', 'Count'],    ['A', 42],    ['B', 28],    ['C', 15],  ])  .setCategoryField(0)  .setValueFields([1])  .setBarStyle({ color: '#2563eb', opacity: 0.8 })  .setCumulativeLineStyle({ color: '#dc2626', width: 2 })  .setIncludeZeroValues(false)  .build()await fSlide.insertChart(chartInfo)

Board

TypeScript
const fBoard = univerAPI.getActiveBoard()const chartInfo = fBoard  .newChart(univerAPI.Enum.ChartTypeString.Pareto)  .setSource([    ['Cause', 'Count'],    ['A', 42],    ['B', 28],    ['C', 15],  ])  .setCategoryField(0)  .setValueFields([1])  .setBarStyle({ color: '#2563eb', opacity: 0.8 })  .setCumulativeLineStyle({ color: '#dc2626', width: 2 })  .setIncludeZeroValues(false)  .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

FParetoChartBuilder.clearBarStyle

Clears the complete Pareto bar style.

After clearing, bars again use the active chart theme palette, full opacity, and renderer-default borders and labels.

This method executes synchronously.

TypeScript
clearBarStyle(): this

Returns

This builder for chaining.

Examples

TypeScript
builder.clearBarStyle()const barStyle = builder.build().config.pareto?.barStyle

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

FParetoChartBuilder.clearCumulativeLineStyle

Clears the complete Pareto cumulative-line style.

The cumulative line remains visible and falls back to the fourth active theme color, a 2 px solid stroke, full opacity, and 7 px points.

This method executes synchronously.

TypeScript
clearCumulativeLineStyle(): this

Returns

This builder for chaining.

Examples

TypeScript
builder.clearCumulativeLineStyle()const lineStyle = builder.build().config.pareto?.cumulativeLineStyle

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

FParetoChartBuilder.resetIncludeZeroValues

Restores the default of excluding zero-valued categories and returns this builder for chaining.

This method executes synchronously.

TypeScript
resetIncludeZeroValues(): this

Returns

This builder for chaining.

Examples

TypeScript
builder.resetIncludeZeroValues()

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

FParetoChartBuilder.setBarStyle

Deep-merges supported Pareto bar appearance.

Omitted fields keep their current values. Without explicit overrides, bars use the active chart theme palette, full opacity, and renderer-default borders and labels.

This method executes synchronously.

Read the current value from builder.build().config.pareto?.barStyle.

TypeScript
setBarStyle(value: IChartParetoBarStyleSpec): this

Parameters

  • value — Required. Supported bar appearance fields.

Returns

This builder for chaining.

Examples

TypeScript
builder.setBarStyle({ color: '#1677ff', opacity: 0.8 })const barStyle = builder.build().config.pareto?.barStyle

Types: IChartParetoBarStyleSpec

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

FParetoChartBuilder.setCumulativeLineStyle

Deep-merges supported Pareto cumulative-line appearance.

Omitted fields keep their current values. Without explicit overrides, the line uses the fourth active theme color, a 2 px solid stroke, full opacity, and 7 px points.

This method executes synchronously.

Non-positive widths are ignored because the cumulative line remains part of Pareto. Read the current value from builder.build().config.pareto?.cumulativeLineStyle.

TypeScript
setCumulativeLineStyle(value: IChartParetoLineStyleSpec): this

Parameters

  • value — Required. Supported cumulative-line appearance fields.

Returns

This builder for chaining.

Examples

TypeScript
builder.setCumulativeLineStyle({ color: '#f5222d', width: 2 })const lineStyle = builder.build().config.pareto?.cumulativeLineStyle

Types: IChartParetoLineStyleSpec

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

FParetoChartBuilder.setIncludeZeroValues

Sets the include zero values configuration and returns this builder for chaining.

This method executes synchronously.

TypeScript
setIncludeZeroValues(value: boolean): this

Parameters

  • value — Required. The semantic value to record.

Returns

This builder for chaining.

Examples

TypeScript
builder.setIncludeZeroValues(true)

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

How is this guide?

© 2026 DreamNum Co., Ltd.