o-spreadsheet API / AbstractChart
AbstractChart is the class from which every Chart should inherit. The role of this class is to maintain the state of each chart.
- copyForSheetId
- copyInSheetId
- getContextCreation
- getDefinition
- getDefinitionForExcel
- updateRanges
- getDefinitionFromContextCreation
- transformDefinition
- validateChartDefinition
• new AbstractChart(definition
, sheetId
, getters
)
Name | Type |
---|---|
definition |
ChartDefinition |
sheetId |
UID |
getters |
CoreGetters |
• Protected
Readonly
getters: CoreGetters
• Readonly
sheetId: UID
• Readonly
title: string
• Readonly
Abstract
type: ChartType
▸ Abstract
copyForSheetId(sheetId
): AbstractChart
Get a copy a the chart adapted to the given sheetId. The ranges that are in the same sheet as the chart will be adapted to the given sheetId.
Name | Type |
---|---|
sheetId |
UID |
▸ Abstract
copyInSheetId(sheetId
): AbstractChart
Get a copy a the chart in the given sheetId. The ranges of the chart will stay the same as the copied chart.
Name | Type |
---|---|
sheetId |
UID |
▸ Abstract
getContextCreation(): ChartCreationContext
Extract the ChartCreationContext of the chart
ChartCreationContext
▸ Abstract
getDefinition(): ChartDefinition
Get the definition of the chart
ChartDefinition
▸ Abstract
getDefinitionForExcel(): undefined
| ExcelChartDefinition
Get the definition of the chart that will be used for excel export. If the chart is not supported by Excel, this function returns undefined.
undefined
| ExcelChartDefinition
▸ Abstract
updateRanges(applyChange
): AbstractChart
This function should be used to update all the ranges of the chart after a grid change (add/remove col/row, rename sheet, ...)
Name | Type |
---|---|
applyChange |
ApplyRangeChange |
▸ Static
getDefinitionFromContextCreation(context
): ChartDefinition
Get an empty definition based on the given context
Name | Type |
---|---|
context |
ChartCreationContext |
ChartDefinition
▸ Static
transformDefinition(definition
, executed
): ChartDefinition
Get a new chart definition transformed with the executed command. This functions will be called during operational transform process
Name | Type |
---|---|
definition |
ChartDefinition |
executed |
AddColumnsRowsCommand | RemoveColumnsRowsCommand |
ChartDefinition
▸ Static
validateChartDefinition(validator
, definition
): CommandResult
| CommandResult
[]
Validate the chart definition given as arguments. This function will be called from allowDispatch function
Name | Type |
---|---|
validator |
Validator |
definition |
ChartDefinition |