@univerjs-pro/sheets-sparkline v0.5.4
Class: FSparkline
Defined in: packages/sheets-sparkline/src/facade/f-sparkline.ts:5
Constructors
new FSparkline()
new FSparkline(
_unitId,
_subUnitId,
_groupId,
_row,
_col,
_injector): FSparkline
Defined in: packages/sheets-sparkline/src/facade/f-sparkline.ts:6
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.ts:12 |
Methods
changeDataSource()
changeDataSource(sourceRange, targetRange): undefined | FSparkline
Defined in: packages/sheets-sparkline/src/facade/f-sparkline.ts:40
Parameters
Parameter | Type | Description |
---|---|---|
sourceRange | IRange | Location of new data source |
targetRange | IRange | New placement |
Returns
undefined
| FSparkline
Return this, for chaining
Description
Modify the data source of the sparkline in the current cell
Example
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
Defined in: packages/sheets-sparkline/src/facade/f-sparkline.ts:87
Returns
void
Description
Delete the sparkline in the current cell
Example
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();