Class: RadarChartBuilder
The builder for creating a radar chart.
Extends
FChartBuilderBase
Properties
Property | Type |
---|---|
| |
|
Methods
build()
build(): IChartBuilderInfo
Builds the chart to reflect all changes made to it.
Returns
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).
Example
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);
Overrides
FChartBuilderBase.build
setFill()
setFill(fill): this
Sets whether the radar chart is filled.
Parameters
Parameter | Type | Description |
---|---|---|
fill | boolean | True if the radar chart is filled; false otherwise. |
Returns
this
this builder, for chaining.
Example
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.
Parameters
Parameter | Type | Description |
---|---|---|
shape | RadarShape | The shape of the radar chart. |
Returns
this
this builder, for chaining.
Example
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);