Skip to Content
ClassesFSparkline

类: FSparkline

The facade class for the sparkline.

方法

changeDataSource()

changeDataSource(sourceRange, targetRange): FSparkline

参数

参数类型描述
sourceRangeIRangeLocation of new data source
targetRangeIRangeNew placement

返回

FSparkline

Return this, for chaining

Description

Modify the data source of the sparkline in the current cell

示例

const workbook = univerAPI.getActiveWorkbook(); const worksheet = workbook.getActiveSheet(); // add sparkline const sparkline = worksheet.addSparkline( [{ startRow: 0, endRow: 6, startColumn: 0, endColumn: 0 }], [{ startRow: 9, endRow: 9, startColumn: 0, endColumn: 0 }] ); // update sparkline data source sparkline.changeDataSource( { startRow: 0, endRow: 6, startColumn: 1, endColumn: 1 }, { startRow: 9, endRow: 9, startColumn: 0, endColumn: 0 } );

removeSparkline()

removeSparkline(): void

返回

void

Description

Delete the sparkline in the current cell

示例

const workbook = univerAPI.getActiveWorkbook(); const worksheet = workbook.getActiveSheet(); const sparkline = worksheet.addSparkline( [{ startRow: 0, endRow: 6, startColumn: 0, endColumn: 0 }], [{ startRow: 9, endRow: 9, startColumn: 0, endColumn: 0 }] ); sparkline.removeSparkline();