Skip to Content
ClassesLineChartBuilder

类: LineChartBuilder

The builder for creating a line chart.

继承

  • FChartBuilderBase

属性

属性类型

dataPointColor

string

dataPointShape

LinePointShape

dataPointSize

number

lineStyle

AreaLineStyle

方法

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 fSheet = fWorkbook.getActiveSheet(); const chartBuilder = fSheet.newChart().asLineChart(); const chartInfo = chartBuilder.addRange('A1:B8') .setLineStyle('smooth') // AreaLineStyle.Smooth .setDataPointShape('triangle') .setDataPointSize(10) .build(); fSheet.insertChart(chartInfo);

重写了

FChartBuilderBase.build

setDataPointColor()

setDataPointColor(dataPointColor): this

The color of the data point in the line chart.

参数

参数类型描述
dataPointColorstringThe color of the data point in the line chart.

返回

this

The builder, for chaining.


setDataPointShape()

setDataPointShape(dataPointShape): this

The shape of the data point in the line chart.

参数

参数类型描述
dataPointShapeLinePointShapeThe shape of the data point in the line chart.

返回

this

  • The builder, for chaining.

setDataPointSize()

setDataPointSize(dataPointSize): this

The size of the data point in the line chart.

参数

参数类型描述
dataPointSizenumberThe size of the data point in the line chart.

返回

this

The builder, for chaining.


setLineStyle()

setLineStyle(lineStyle): this

The line style of the area chart.

参数

参数类型描述
lineStyleAreaLineStyleThe line style of the line chart.

返回

this

  • The builder, for chaining.