Skip to Content
ClassesRadarChartBuilder

类: RadarChartBuilder

The builder for creating a radar chart.

继承

  • FChartBuilderBase

属性

属性类型

fill

boolean

shape

RadarShape

方法

build()

build(): IChartBuilderInfo;

Builds the chart to reflect all changes made to it.

返回

IChartBuilderInfo

The chart builder info.

Description

This method does not automatically draw the chart on top of the spreadsheet. A new chart must be inserted via sheet.insertChart(chart), and an existing chart should be updated via sheet.updateChart(chart).

示例

const fWorkbook = univerAPI.getActiveWorkbook(); const fWorksheet = fWorkbook.getActiveSheet(); // Create a radar chart with data source A1:D6. // The starting position is upper-left corner of cell B2. // The shape of the radar chart is set to polygon and filled with red color. const chartInfo = fWorksheet.newChart() .asRadarChart() .addRange('A1:D6') .setPosition(1, 1, 0, 0) .setShape(univerAPI.Enum.RadarShape.Polygon) .setFill(true) .build(); await fWorksheet.insertChart(chartInfo);

重写了

FChartBuilderBase.build

setFill()

setFill(fill): this;

Sets whether the radar chart is filled.

参数

参数类型描述
fillbooleanTrue if the radar chart is filled; false otherwise.

返回

this

this builder, for chaining.

示例

const fWorkbook = univerAPI.getActiveWorkbook(); const fWorksheet = fWorkbook.getActiveSheet(); // Create a radar chart with data source A1:D6. // The starting position is upper-left corner of cell B2. // The shape of the radar chart is set to polygon and filled with red color. const chartInfo = fWorksheet.newChart() .asRadarChart() .addRange('A1:D6') .setPosition(1, 1, 0, 0) .setShape(univerAPI.Enum.RadarShape.Polygon) .setFill(true) .build(); await fWorksheet.insertChart(chartInfo);

setShape()

setShape(shape): this;

Sets the shape of the radar chart.

参数

参数类型描述
shapeRadarShapeThe shape of the radar chart.

返回

this

this builder, for chaining.

示例

const fWorkbook = univerAPI.getActiveWorkbook(); const fWorksheet = fWorkbook.getActiveSheet(); // Create a radar chart with data source A1:D6. // The starting position is upper-left corner of cell B2. // The shape of the radar chart is set to polygon and filled with red color. const chartInfo = fWorksheet.newChart() .asRadarChart() .addRange('A1:D6') .setPosition(1, 1, 0, 0) .setShape(univerAPI.Enum.RadarShape.Polygon) .setFill(true) .build(); await fWorksheet.insertChart(chartInfo);