import type { IRange } from '@univerjs/core'; import { Injector } from '@univerjs/core'; /** * The facade class for the sparkline. * @hideconstructor */ export declare class FSparkline { private _unitId; private _subUnitId; private _groupId; private _row; private _col; protected readonly _injector: Injector; constructor(_unitId: string, _subUnitId: string, _groupId: string, _row: number, _col: number, _injector: Injector); /** * @description Modify the data source of the sparkline in the current cell * @param {IRange} sourceRange Location of new data source * @param {IRange} targetRange New placement * @returns {FSparkline | undefined} Return this, for chaining * * @example * ```ts * const fWorkbook = univerAPI.getActiveWorkbook(); * const fWorksheet = fWorkbook.getSheetByName('Sheet1'); * if (!fWorksheet) return; * * // Create a sparkline in the range A10, with the data source in the range A1:A7. * fWorksheet.addSparkline( * [fWorksheet.getRange('A1:A7').getRange()], * [fWorksheet.getRange('A10').getRange()] * ); * const sparkline = fWorksheet.getSparklineByCell(9, 0); * if (!sparkline) return; * * // Modify the data source of the sparkline to the range B1:B7, and move it to the range B10 after 3 seconds. * setTimeout(() => { * sparkline.changeDataSource( * fWorksheet.getRange('B1:B7').getRange(), * fWorksheet.getRange('B10').getRange() * ); * }, 3000); * ``` */ changeDataSource(sourceRange: IRange, targetRange: IRange): FSparkline | undefined; /** * @description Delete the sparkline in the current cell * * @example * ```ts * const fWorkbook = univerAPI.getActiveWorkbook(); * const fWorksheet = fWorkbook.getSheetByName('Sheet1'); * if (!fWorksheet) return; * * // Create a sparkline in the range A10, with the data source in the range A1:A7. * fWorksheet.addSparkline( * [fWorksheet.getRange('A1:A7').getRange()], * [fWorksheet.getRange('A10').getRange()] * ); * const sparkline = fWorksheet.getSparklineByCell(9, 0); * if (!sparkline) return; * * // Remove the sparkline after 3 seconds. * setTimeout(() => { * sparkline.removeSparkline(); * }, 3000); * ``` */ removeSparkline(): void; }