FWordCloudChartBuilder
Fluent, type-specific Builder for Word Cloud Charts.
Inheritance
Extends FChartBuilderBase. Its inherited members are available on this object.
Example
Sheet
const fWorkbook = univerAPI.getActiveWorkbook()const fWorksheet = fWorkbook.getSheetByName('Sheet1')const chartInfo = fWorksheet .newChart(univerAPI.Enum.ChartTypeString.WordCloud) .setSource('A1:B8') .setCategoryField(0) .setValueFields([1]) .setShape(univerAPI.Enum.ChartWordCloudShapeEnum.Circle) .setRepeat(true) .build()await fWorksheet.insertChart(chartInfo)Doc
const fDocument = univerAPI.getActiveDocument()const chartInfo = fDocument .newChart(univerAPI.Enum.ChartTypeString.WordCloud) .setSource([ ['Word', 'Frequency'], ['Univer', 42], ['Chart', 28], ['Data', 18], ]) .setCategoryField(0) .setValueFields([1]) .setShape(univerAPI.Enum.ChartWordCloudShapeEnum.Circle) .setRepeat(true) .build()await fDocument.insertChart(chartInfo)Slide
const fPresentation = univerAPI.getActivePresentation()const fSlide = fPresentation.getSlideByIndex(0)const chartInfo = fSlide .newChart(univerAPI.Enum.ChartTypeString.WordCloud) .setSource([ ['Word', 'Frequency'], ['Univer', 42], ['Chart', 28], ['Data', 18], ]) .setCategoryField(0) .setValueFields([1]) .setShape(univerAPI.Enum.ChartWordCloudShapeEnum.Circle) .setRepeat(true) .build()await fSlide.insertChart(chartInfo)Board
const fBoard = univerAPI.getActiveBoard()const chartInfo = fBoard .newChart(univerAPI.Enum.ChartTypeString.WordCloud) .setSource([ ['Word', 'Frequency'], ['Univer', 42], ['Chart', 28], ['Data', 18], ]) .setCategoryField(0) .setValueFields([1]) .setShape(univerAPI.Enum.ChartWordCloudShapeEnum.Circle) .setRepeat(true) .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
FWordCloudChartBuilder.clearMaskImage
Clears the mask image configuration and returns this builder for chaining.
This method executes synchronously.
clearMaskImage(): thisReturns
This builder for chaining.
Examples
builder.clearMaskImage()Package: @univerjs-pro/engine-chart · Type definitions
FWordCloudChartBuilder.resetRepeat
Restores the default of not repeating words and returns this builder for chaining.
This method executes synchronously.
resetRepeat(): thisReturns
This builder for chaining.
Examples
builder.resetRepeat()Package: @univerjs-pro/engine-chart · Type definitions
FWordCloudChartBuilder.resetShape
Restores the word-cloud shape to Cloud and returns this builder for chaining.
This method executes synchronously.
resetShape(): thisReturns
This builder for chaining.
Examples
builder.resetShape()Package: @univerjs-pro/engine-chart · Type definitions
FWordCloudChartBuilder.setMaskImage
Sets the mask image configuration and returns this builder for chaining.
This method executes synchronously.
setMaskImage(resourceId: string): thisParameters
resourceId— Required. The host resource ID.
Returns
This builder for chaining.
Examples
builder.setMaskImage('resource-id')Package: @univerjs-pro/engine-chart · Type definitions
FWordCloudChartBuilder.setRepeat
Sets the repeat configuration and returns this builder for chaining.
This method executes synchronously.
setRepeat(value: boolean): thisParameters
value— Required. The semantic value to record.
Returns
This builder for chaining.
Examples
builder.setRepeat(true)Package: @univerjs-pro/engine-chart · Type definitions
FWordCloudChartBuilder.setShape
Sets the shape configuration and returns this builder for chaining.
This method executes synchronously.
setShape(value: WordCloudShapeEnum): thisParameters
value— Required. The semantic value to record.
Returns
This builder for chaining.
Examples
builder.setShape(univerAPI.Enum.ChartWordCloudShapeEnum.Cloud)Types: WordCloudShapeEnum
Package: @univerjs-pro/engine-chart · Type definitions
How is this guide?