类: LineChartBuilder
The builder for creating a line 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).
示例
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.
参数
参数 | 类型 | 描述 |
---|---|---|
dataPointColor | string | The 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.
参数
参数 | 类型 | 描述 |
---|---|---|
dataPointShape | LinePointShape | The 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.
参数
参数 | 类型 | 描述 |
---|---|---|
dataPointSize | number | The 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.
参数
参数 | 类型 | 描述 |
---|---|---|
lineStyle | AreaLineStyle | The line style of the line chart. |
返回
this
- The builder, for chaining.