[]
• new Chart(sheet
, name
, chartType
, x
, y
, width
, height
, dataRange?
, dataOrientation?
, colorScheme?
)
Represents a chart.
Name | Type | Description |
---|---|---|
sheet |
Worksheet |
The host sheet of the chart. |
name |
string |
The name of the chart. |
chartType |
ChartType |
The type of the chart. |
x |
number |
The x location of the chart. |
y |
number |
The y location of the chart. |
width |
number |
The width of the chart. |
height |
number |
The height of the chart. |
dataRange? |
string |
- |
dataOrientation? |
RowCol |
- |
colorScheme? |
ColorScheme |
- |
• typeName: string
Represents the type name string used for supporting serialization.
▸ allowMove(value?
): any
Gets or sets whether to disable moving the chart.
Name | Type | Description |
---|---|---|
value? |
boolean |
The setting for whether to disable moving the chart. |
any
If no value is set, returns the setting for whether to disable moving the chart; otherwise, returns the chart.
▸ allowResize(value?
): any
Gets or sets whether to disable resizing the chart.
Name | Type | Description |
---|---|---|
value? |
boolean |
The setting for whether to disable resizing the chart. |
any
If no value is set, returns the setting for whether to disable resizing the chart; otherwise, returns the chart.
▸ alt(value?
): any
Gets or sets the alternative text of the chart for screen readers.
Name | Type | Description |
---|---|---|
value? |
string |
The alternative text of the chart. |
any
The alternative text of the chart.
▸ axes(value?
): any
Gets or sets the chart axes of the chart.
Name | Type |
---|---|
value? |
IAxes |
any
If no value is set, returns the chart axes of the chart; otherwise, returns the chart.
▸ canPrint(value?
): any
Gets or sets whether this chart is printable.
Name | Type | Description |
---|---|---|
value? |
boolean |
The value that indicates whether this chart is printable. |
any
If no value is set, returns whether this chart is printable.
▸ chartArea(value?
): any
Gets or sets the chart area style of the chart.
Name | Type |
---|---|
value? |
IChartArea |
any
If no value is set, returns the chart area style of the chart; otherwise, returns the chart.
▸ chartType(value?
): any
Gets or sets the type of the chart.
Name | Type |
---|---|
value? |
ChartType |
any
If no value is set, returns the type of the chart; otherwise, returns the chart.
▸ cloneContent(): HTMLElement
Gets a copy of the current content of the instance.
deprecated
since version 17.0.0, This method is not available in the charts plugin, to use this method, please use the legacy-charts plugin.
HTMLElement
A copy of the current content of the instance.
▸ colorScheme(value?
): ColorScheme
| Chart
Gets or sets the chart colors.
Name | Type | Description |
---|---|---|
value? |
ColorScheme |
that represent the chart color style. |
If no value is set, returns the current chart color style, otherwise, returns the chart.
▸ content(value?
): any
Gets or sets the content of the custom chart.
deprecated
since version 17.0.0, This method is not available in the charts plugin, to use this method, please use the legacy-charts plugin.
Name | Type | Description |
---|---|---|
value? |
HTMLElement |
The content of the custom chart. |
any
If no value is set, returns the content of the custom chart; otherwise, returns the chart.
▸ dataLabels(value?
): any
Gets or sets the chart data labels style of the chart.
Name | Type |
---|---|
value? |
IDataLabels |
any
If no value is set, returns the chart data labels style of the chart; otherwise, returns the chart.
▸ dataRange(value?
): any
Gets or sets the whole data range of the chart as formula string.
Name | Type |
---|---|
value? |
string |
any
If no value is set, returns the formula string of the whole data range for the chart; otherwise, returns the chart.
▸ displayBlanksAs(value?
): any
Gets or sets the way that the chart display blank data.
Name | Type |
---|---|
value? |
DisplayBlanksAs |
any
If no value is set, returns the way that the chart display blank data, otherwise, returns the chart.
▸ displayNaAsBlank(value?
): boolean
| Chart
Gets or sets whether to show #N/A cells as blank cells.
Name | Type | Description |
---|---|---|
value? |
boolean |
that whether to show #N/A cells as blank cells. |
boolean
| Chart
If no value is set, returns whether to show #N/A cells as blank cells, otherwise, returns the chart.
▸ dynamicMove(value?
): any
Gets or sets whether the object moves when hiding or showing, resizing, or moving rows or columns.
Name | Type | Description |
---|---|---|
value? |
boolean |
The value indicates whether the object moves when hiding or showing, resizing, or moving rows or columns. |
any
If no value is set, returns whether this chart dynamically moves; otherwise, returns the chart.
▸ dynamicSize(value?
): any
Gets or sets whether the position of the chart is fixed. When fixedPosition is true, dynamicMove and dynamicSize are disabled.
Name | Type | Description |
---|---|---|
value? |
boolean |
The value indicates whether the position of the chart is fixed. |
any
If no value is set, returns whether the position of the chart is fixed; otherwise, returns the chart.
▸ endColumn(value?
): any
Gets or sets the end column index of the chart position.
Name | Type | Description |
---|---|---|
value? |
number |
The end column index of the chart position. |
any
If no value is set, returns the end column index of the chart position; otherwise, returns the chart.
▸ endColumnOffset(value?
): any
Gets or sets the offset relative to the end column of the chart.
Name | Type | Description |
---|---|---|
value? |
number |
The offset relative to the end column of the chart. |
any
If no value is set, returns the offset relative to the end column of the chart; otherwise, returns the chart.
▸ endRow(value?
): any
Gets or sets the end row index of the chart position.
Name | Type | Description |
---|---|---|
value? |
number |
The end row index of the chart position. |
any
If no value is set, returns the end row index of the chart position; otherwise, returns the chart.
▸ endRowOffset(value?
): any
Gets or sets the offset relative to the end row of the chart.
Name | Type | Description |
---|---|---|
value? |
number |
The offset relative to the end row of the chart. |
any
If no value is set, returns the offset relative to the end row of the chart; otherwise, returns the chart.
▸ fixedPosition(value
): any
Gets or sets whether the size of the object changes when hiding or showing, resizing, or moving rows or columns.
deprecated
since version 17.0.0, This method is not available in the charts plugin, to use this method, please use the legacy-charts plugin.
Name | Type | Description |
---|---|---|
value |
boolean |
The value indicates whether the size of the object changes when hiding or showing, resizing, or moving rows or columns. |
any
If no value is set, returns whether this chart dynamically changes size; otherwise, returns the chart.
▸ formatOvers(value?
): IFormatOvers
| Chart
Gets or sets waterfall chart different points collection style.
Name | Type | Description |
---|---|---|
value? |
IFormatOvers |
The specific data points collection style of the waterfall chart. |
If no value is set, return waterfall chart different points collection styles
▸ getFormula(path
): string
Gets the formula string from the chart by the path.
Name | Type | Description |
---|---|---|
path |
string |
The path which can accept a formula string, it could be one of "x", "y", "width", "height". |
string
Returns the formula string from the chart by the path.
▸ getHost(): HTMLElement
[]
Gets the dom host of the custom content.
deprecated
since version 17.0.0, This method is not available in the charts plugin, to use this method, please use the legacy-charts plugin.
HTMLElement
[]
▸ height(value?
): any
Gets or sets the height of a chart.
Name | Type | Description |
---|---|---|
value? |
number |
The height of a chart. |
any
If no value is set, returns the height of a chart; otherwise, returns the chart.
▸ hoverStyle(value?
): any
Gets or sets the style when user hover over the dataPoint.
Name | Type |
---|---|
value? |
IHoverStyle |
any
If no value is set, returns the current hover style of the chart; otherwise, returns the chart.
▸ ignoreHidden(value?
): boolean
| Chart
Gets or sets the way that if the chart display hidden rows and columns data.
Name | Type | Description |
---|---|---|
value? |
boolean |
the value that if the chart display hidden rows and columns data. |
boolean
| Chart
If no value is set, returns the value that if the chart display hidden rows and columns data, otherwise, returns the chart.
▸ isLocked(value?
): any
Gets or sets whether this chart is locked.
Name | Type | Description |
---|---|---|
value? |
boolean |
The value that indicates whether this chart is locked. |
any
If no value is set, returns whether this chart is locked; otherwise, returns the chart.
▸ isSelected(value?
): any
Gets or sets whether this chart is selected.
Name | Type | Description |
---|---|---|
value? |
boolean |
The value that indicates whether this chart is selected. |
any
If no value is set, returns whether this chart is selected; otherwise, returns the chart.
▸ isVisible(value?
): any
Gets or sets whether this chart is visible.
Name | Type | Description |
---|---|---|
value? |
boolean |
The value that indicates whether this chart is visible. |
any
If no value is set, returns whether this chart is visible; otherwise, returns the chart.
▸ legend(value?
): any
Gets or sets the legend of the chart.
Name | Type |
---|---|
value? |
IChartLegend |
any
If no value is set, returns the legend of the chart; otherwise, returns the chart.
▸ name(value?
): any
Gets the name of the chart.
Name | Type | Description |
---|---|---|
value? |
string |
The name of the chart. |
any
If no value is set, returns the name of the chart; otherwise, returns the chart.
▸ refreshContent(): void
Refreshes the chart, in most cases does not need to call this method.
void
▸ series(): SeriesCollection
Gets the series collection of the chart.
Returns the series collection of the chart.
▸ setFormula(path
, formula
): void
Sets the formula string to the chart by the path.
Name | Type | Description |
---|---|---|
path |
string |
The path which can accept a formula string, it could be one of "x", "y", "width", "height". |
formula |
string |
The formula string. |
void
▸ startColumn(value?
): any
Gets or sets the starting column index of the chart position.
Name | Type | Description |
---|---|---|
value? |
number |
The starting column index of the chart position. |
any
If no value is set, returns the starting column index of the chart position; otherwise, returns the chart.
▸ startColumnOffset(value?
): any
Gets or sets the offset relative to the start column of the chart.
Name | Type | Description |
---|---|---|
value? |
number |
The offset relative to the start column of the chart. |
any
If no value is set, returns the offset relative to the start column of the chart; otherwise, returns the chart.
▸ startRow(value?
): any
Gets or sets the starting row index of the chart position.
Name | Type | Description |
---|---|---|
value? |
number |
The starting row index of the chart position. |
any
If no value is set, returns the starting row index of the chart position; otherwise, returns the chart.
▸ startRowOffset(value?
): any
Gets or sets the offset relative to the start row of the chart.
Name | Type | Description |
---|---|---|
value? |
number |
The offset relative to the start row of the chart. |
any
If no value is set, returns the offset relative to the start row of the chart; otherwise, returns the chart.
▸ switchDataOrientation(): boolean
Switches the data orientation between rows and columns.
boolean
Returns true when data orienetation is changable and successful switched; otherwise, false.
▸ title(value?
): any
Gets or sets the title of the chart.
Name | Type |
---|---|
value? |
IChartTitle |
any
If no value is set, returns the title of the chart; otherwise, returns the chart.
▸ toImageSrc(): string
Get the chart Image src of type Base64 string.
example
let chartImageSrc = sheet.charts.all()[0].toImageSrc();
string
return the chart Image Base64 src string.
▸ useAnimation(value?
): any
Gets or sets whether apply animation to the chart.
Name | Type |
---|---|
value? |
boolean |
any
If no value is set, returns whether apply animation to the chart; otherwise, returns the chart.
▸ width(value?
): any
Gets or sets the width of a chart.
Name | Type | Description |
---|---|---|
value? |
number |
The width of a chart. |
any
If no value is set, returns the width of a chart; otherwise, returns the chart.
▸ x(value?
): any
Gets or sets the horizontal location of the chart.
Name | Type | Description |
---|---|---|
value? |
number |
The horizontal location of the chart. |
any
If no value is set, returns the horizontal location of the chart; otherwise, returns the chart.
▸ y(value?
): any
Gets or sets the vertical location of the chart.
Name | Type | Description |
---|---|---|
value? |
number |
The vertical location of the chart. |
any
If no value is set, returns the vertical location of the chart; otherwise, returns the chart.