@univerjs-pro/engine-chart
Shared chart runtime for Sheets, Docs, Slides, and Boards. It owns common chart models, themes, styles, data-source utilities, and word-cloud rendering configuration.
import { UniverChartPlugin } from '@univerjs-pro/engine-chart'import '@univerjs-pro/engine-chart/facade'univer.registerPlugin(UniverChartPlugin, { wordCloudRenderConfig: { // Optional ECharts word-cloud renderer defaults. },})Product-specific chart plugins depend on this shared runtime. Continue registering the Sheets, Docs, Slides, or Boards chart plugin for the host you use.
For Docs, Slides, or Boards charts that reference another document's data, also register UniverChartEmbedPlugin. Reference loading, IResourceRefChartDataSourceInput, and IChartDataSourceRuntimeService are exported by @univerjs-pro/chart-embed. The engine provides inline data, IChartDataSourceDescriptor, IChartHostDataSourceBinding, ChartInlineDataSourceBinding, ChartProjectedDataSource, and the shared ChartDataSourceRuntimeStatus / IChartDataSourceStatus types.
The Facade entry provides shared chart builders and the live FChart API. Host facades expose newChart(type), insertChart(info), getChart(id), and getCharts(). Builders accept data through setSource(); inserted charts use setDataSource() or toBuilder() plus update(). See the Chart Facade lifecycle for a complete example.
For hierarchical labels, call setCategoryFields(indexes) in root-to-leaf order and enable setMultiLevelCategoryAxis(true). Both detached builders and live charts expose these methods. The root entry also exports IChartDataCategoryLevel, IChartDataCategorySegment, and IUniverDataSetCategorySpan for integrations that construct chart datasets directly.
3D views and logarithmic scales
The shared renderer supports 3D Line, Column, Bar, Pie, and Area families through their ChartTypeString variants. Use FThreeDChartBuilder.setThreeD() for the view and FAxisThreeDChartBuilder.setDepthAxis() for the depth axis. Existing product chart plugins register this runtime. See 3D chart examples.
Supported 2D numeric axes accept scaleType: 'log' and an optional logBase. Configure the axis with FAxisChartBuilder, then apply the detached builder to an existing chart with await chart.update(builder.build()). See logarithmic axes for supported chart types, positive-data requirements, and restoring a linear scale.
IUniverChartConfig
export interface IUniverChartConfig { wordCloudRenderConfig?: IWordCloudRenderConfig}Entry Points
- Facade:
@univerjs-pro/engine-chart/facade - Locale:
@univerjs-pro/engine-chart/locale/*
How is this guide?