@univerjs-pro/sheets-sparkline v0.5.4
Class: FSparklineGroup
Defined in: packages/sheets-sparkline/src/facade/f-sparkline-group.ts:6
Constructors
new FSparklineGroup()
new FSparklineGroup(
_unitId,
_subUnitId,
_groupId,
_row,
_col,
_injector): FSparklineGroup
Defined in: packages/sheets-sparkline/src/facade/f-sparkline-group.ts:7
Parameters
Parameter | Type |
---|---|
_unitId | string |
_subUnitId | string |
_groupId | string |
_row | number |
_col | number |
_injector | Injector |
Returns
Properties
Property | Modifier | Type | Defined in |
---|---|---|---|
_injector | readonly | Injector | packages/sheets-sparkline/src/facade/f-sparkline-group.ts:13 |
Methods
changeDataSource()
changeDataSource(sourceRanges, targetRanges): undefined | FSparklineGroup
Defined in: packages/sheets-sparkline/src/facade/f-sparkline-group.ts:34
Parameters
Parameter | Type | Description |
---|---|---|
sourceRanges | IRange [] | Location of new data source |
targetRanges | IRange [] | New placement |
Returns
undefined
| FSparklineGroup
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
Defined in: packages/sheets-sparkline/src/facade/f-sparkline-group.ts:80
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
Defined in: packages/sheets-sparkline/src/facade/f-sparkline-group.ts:103
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 });