FFunnelChartBuilder
Fluent, type-specific Builder for Funnel 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.Funnel) .setSource('A1:B8') .setGap(4) .setUseAbsoluteValue(true) .build()await fWorksheet.insertChart(chartInfo)Doc
const fDocument = univerAPI.getActiveDocument()const chartInfo = fDocument .newChart(univerAPI.Enum.ChartTypeString.Funnel) .setSource([ ['Stage', 'Users'], ['Visited', 1000], ['Signed up', 420], ['Purchased', 160], ]) .setGap(4) .setUseAbsoluteValue(true) .build()await fDocument.insertChart(chartInfo)Slide
const fPresentation = univerAPI.getActivePresentation()const fSlide = fPresentation.getSlideByIndex(0)const chartInfo = fSlide .newChart(univerAPI.Enum.ChartTypeString.Funnel) .setSource([ ['Stage', 'Users'], ['Visited', 1000], ['Signed up', 420], ['Purchased', 160], ]) .setGap(4) .setUseAbsoluteValue(true) .build()await fSlide.insertChart(chartInfo)Board
const fBoard = univerAPI.getActiveBoard()const chartInfo = fBoard .newChart(univerAPI.Enum.ChartTypeString.Funnel) .setSource([ ['Stage', 'Users'], ['Visited', 1000], ['Signed up', 420], ['Purchased', 160], ]) .setGap(4) .setUseAbsoluteValue(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
FFunnelChartBuilder.resetGap
Restores the gap to 2 px and returns this builder for chaining.
This method executes synchronously.
resetGap(): thisReturns
This builder for chaining.
Examples
builder.resetGap()Package: @univerjs-pro/engine-chart · Type definitions
FFunnelChartBuilder.resetUseAbsoluteValue
Restores the default of preserving signed values and returns this builder for chaining.
This method executes synchronously.
resetUseAbsoluteValue(): thisReturns
This builder for chaining.
Examples
builder.resetUseAbsoluteValue()Package: @univerjs-pro/engine-chart · Type definitions
FFunnelChartBuilder.setGap
Sets the gap configuration and returns this builder for chaining.
This method executes synchronously.
setGap(value: number): thisParameters
value— Required. The semantic value to record.
Returns
This builder for chaining.
Examples
builder.setGap(8)Package: @univerjs-pro/engine-chart · Type definitions
FFunnelChartBuilder.setUseAbsoluteValue
Sets the use absolute value configuration and returns this builder for chaining.
This method executes synchronously.
setUseAbsoluteValue(value: boolean): thisParameters
value— Required. The semantic value to record.
Returns
This builder for chaining.
Examples
builder.setUseAbsoluteValue(true)Package: @univerjs-pro/engine-chart · Type definitions
How is this guide?