Class: FSparklineGroup
The facade class for the sparkline group.Which uses to setting multiple sparklines, all sparkline in the same group will share the configs.
Methods
changeDataSource()
changeDataSource(sourceRanges, targetRanges): FSparklineGroup
Parameters
Parameter | Type | Description |
---|---|---|
sourceRanges | IRange [] | Location of new data source |
targetRanges | IRange [] | New placement |
Returns
Return this, for chaining
Description
Modify the data source of the sparkline group
Example
const workbook = univerAPI.getActiveWorkbook();
const worksheet = workbook.getActiveSheet();
// get sparkline by cell
const sparklineGroup = worksheet.getSparklineGroupByCell(9, 0);
sparklineGroup.changeDataSource(
[{ startRow: 0, endRow: 6, startColumn: 1, endColumn: 1 }],
[{ startRow: 9, endRow: 9, startColumn: 0, endColumn: 0 }]
);
removeSparklineGroup()
removeSparklineGroup(): void
Returns
void
Description
Delete the sparkline group
Example
const workbook = univerAPI.getActiveWorkbook();
const worksheet = workbook.getActiveSheet();
// get sparkline by cell
const sparklineGroup = worksheet.getSparklineGroupByCell(9, 0);
// remove sparkline group
sparklineGroup.removeSparkline();
setConfig()
setConfig(config): FSparklineGroup
Parameters
Parameter | Type | Description |
---|---|---|
config | ISparklineGroupConfig | new sparkline group config |
Returns
Return this, for chaining
Description
Modify the configuration of the current sparkline group
Example
const workbook = univerAPI.getActiveWorkbook();
const worksheet = workbook.getActiveSheet();
const sparkline = worksheet.getSparklineGroupByCell(9, 0);
// set sparkline type to bar chart
sparkline.setConfig({ type: SparklineTypeEnum.BAR_CHART });