FRadarChartBuilder
Fluent, type-specific Builder for Radar 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.Radar) .setSource('A1:D8') .setCategoryField(0) .setValueFields([1, 2, 3]) .setShape(univerAPI.Enum.ChartRadarShape.Circle) .setFill(true) .build()await fWorksheet.insertChart(chartInfo)Doc
const fDocument = univerAPI.getActiveDocument()const chartInfo = fDocument .newChart(univerAPI.Enum.ChartTypeString.Radar) .setSource([ ['Metric', 'Product A', 'Product B'], ['Speed', 80, 72], ['Quality', 90, 84], ]) .setCategoryField(0) .setValueFields([1, 2]) .setShape(univerAPI.Enum.ChartRadarShape.Circle) .setFill(true) .build()await fDocument.insertChart(chartInfo)Slide
const fPresentation = univerAPI.getActivePresentation()const fSlide = fPresentation.getSlideByIndex(0)const chartInfo = fSlide .newChart(univerAPI.Enum.ChartTypeString.Radar) .setSource([ ['Metric', 'Product A', 'Product B'], ['Speed', 80, 72], ['Quality', 90, 84], ]) .setCategoryField(0) .setValueFields([1, 2]) .setShape(univerAPI.Enum.ChartRadarShape.Circle) .setFill(true) .build()await fSlide.insertChart(chartInfo)Board
const fBoard = univerAPI.getActiveBoard()const chartInfo = fBoard .newChart(univerAPI.Enum.ChartTypeString.Radar) .setSource([ ['Metric', 'Product A', 'Product B'], ['Speed', 80, 72], ['Quality', 90, 84], ]) .setCategoryField(0) .setValueFields([1, 2]) .setShape(univerAPI.Enum.ChartRadarShape.Circle) .setFill(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
FRadarChartBuilder.resetFill
Restores the default of drawing outlines without area fill and returns this builder for chaining.
This method executes synchronously.
resetFill(): thisReturns
This builder for chaining.
Examples
builder.resetFill()Package: @univerjs-pro/engine-chart · Type definitions
FRadarChartBuilder.resetShape
Restores the radar grid shape to Polygon 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
FRadarChartBuilder.setFill
Sets the fill configuration and returns this builder for chaining.
This method executes synchronously.
setFill(value: boolean): thisParameters
value— Required. The semantic value to record.
Returns
This builder for chaining.
Examples
builder.setFill(true)Package: @univerjs-pro/engine-chart · Type definitions
FRadarChartBuilder.setShape
Sets the shape configuration and returns this builder for chaining.
This method executes synchronously.
setShape(value: RadarShape): thisParameters
value— Required. The semantic value to record.
Returns
This builder for chaining.
Examples
builder.setShape(univerAPI.Enum.ChartRadarShape.Polygon)Types: RadarShape
Package: @univerjs-pro/engine-chart · Type definitions
你觉得这篇文档如何?