类: RadarChartBuilder
The builder for creating a radar chart.
继承
FChartBuilderBase
属性
属性 | 类型 |
---|---|
| |
|
方法
build()
build(): IChartBuilderInfo
Builds the chart to reflect all changes made to it.
返回
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).
示例
// import { ChartTypeBits } from '@univerjs-pro/sheets-chart';
const fWorkbook = univerAPI.getActiveWorkbook();
const fSheet = fWorkbook.getActiveSheet();
const chartBuilder = fSheet.newChart().asRadarChart();
const chartInfo = chartBuilder.addRange('A1:B8')
.setChartType(univerAPI.Enum.ChartType.Radar)
.setShape(RadarShape.Polygon)
.setFill(true)
.build();
fSheet.insertChart(chartInfo);
重写了
FChartBuilderBase.build
setFill()
setFill(fill): this
Sets whether the radar chart is filled.
参数
参数 | 类型 | 描述 |
---|---|---|
fill | boolean | True if the radar chart is filled; false otherwise. |
返回
this
this builder, for chaining.
示例
// import { ChartTypeBits } from '@univerjs-pro/sheets-chart';
const fWorkbook = univerAPI.getActiveWorkbook();
const fSheet = fWorkbook.getActiveSheet();
const chartBuilder = fSheet.newChart().asRadarChart();
const chartInfo = chartBuilder.addRange('A1:B8')
.setFill(true)
.build();
fSheet.insertChart(chartInfo);
setShape()
setShape(shape): this
Sets the shape of the radar chart.
参数
参数 | 类型 | 描述 |
---|---|---|
shape | RadarShape | The shape of the radar chart. |
返回
this
this builder, for chaining.
示例
// import { ChartTypeBits, RadarShape } from '@univerjs-pro/sheets-chart';
const fWorkbook = univerAPI.getActiveWorkbook();
const fSheet = fWorkbook.getActiveSheet();
const chartBuilder = fSheet.newChart().asRadarChart();
const chartInfo = chartBuilder.addRange('A1:B8')
.setShape(RadarShape.Polygon)
.build();
fSheet.insertChart(chartInfo);