AnyChart
API Reference
Still have questions?
Contact support
Top
You are looking at an outdated 7.2.0 version of this document. Switch to the 8.4.0 version to see the up to date information.

class anychart.cartesian.Chart Improve this Doc

Extends: anychart.Chart

Cartesian chart class.
To get the chart use any of these methods:

Chart can contain any number of series. Each series is interactive, you can customize click and hover behavior and other params.

Methods Overview

Miscellaneous
area()Adds Area series.
bar()Adds Bar series.
barGroupsPadding()Getter for space between bar groups on the ordinal scale by ratio of bars width.
barsPadding()Getter for space between bars on the ordinal scale by ratio of bars width.
bubble()Adds Bubble series.
candlestick()Adds Candlestick series.
column()Adds Column series.
getSeries()Getter series by index.
grid()Getter for chart grid.
line()Adds Line series.
lineMarker()Getter for chart line marker.
marker()Adds Marker series.
minorGrid()Getter for chart minor grid.
ohlc()Adds OHLC series.
palette()Getter for series colors palette.
rangeArea()Adds RangeArea series.
rangeBar()Adds RangeBar series.
rangeColumn()Adds RangeColumn series.
rangeMarker()Getter for chart range marker.
rangeSplineArea()Adds RangeSplineArea series.
rangeStepArea()Adds RangeColumn series.
spline()Adds Spline series.
splineArea()Adds SplineArea series.
stepArea()Adds StepArea series.
stepLine()Adds StepLine series.
textMarker()Getter for chart text marker.
xAxis()Getter for chart X-axis.
xScale()Getter for default chart X scale.
yAxis()Getter for chart Y-axis.
yScale()Getter for default chart Y scale.

Methods Description

area

Adds Area series.

Params:

NameTypeDescription
dataanychart.data.View | anychart.data.Set | ArrayData for the series.
csvSettingsObject.<string, (string|boolean)>If CSV string is passed, you can pass CSV parser settings here as a hash map.

Returns:

anychart.cartesian.series.Base - anychart.cartesian.series.Area instance for method chaining.

bar

Adds Bar series.

Params:

NameTypeDescription
dataanychart.data.View | anychart.data.Set | Array | stringData for the series.
csvSettingsObject.<string, (string|boolean)>If CSV string is passed, you can pass CSV parser settings here as a hash map.

Returns:

anychart.cartesian.series.Base - anychart.cartesian.series.Bar instance for method chaining.

barGroupsPadding

Getter for space between bar groups on the ordinal scale by ratio of bars width.

Returns:

number - Current bar groups padding.
Setter for space between bar groups on the ordinal scale by ratio of bars width.
See illustration at anychart.cartesian.Chart#barsPadding.

Params:

NameTypeDefaultDescription
valuenumber
0.1
Value to set.

Returns:

anychart.cartesian.Chart - anychart.cartesian.Chart instance for method chaining.

barsPadding

Getter for space between bars on the ordinal scale by ratio of bars width.

Returns:

number - Current bars padding.
Setter for space between bars on the ordinal scale by ratio of bars width.

Params:

NameTypeDefaultDescription
valuenumber
0.1
Value to set.

Returns:

anychart.cartesian.Chart - anychart.cartesian.Chart instance for method chaining.

bubble

Adds Bubble series.

Params:

NameTypeDescription
dataanychart.data.View | anychart.data.Set | Array | stringData for the series.
csvSettingsObject.<string, (string|boolean)>If CSV string is passed, you can pass CSV parser settings here as a hash map.

candlestick

Adds Candlestick series.

Params:

NameTypeDescription
dataanychart.data.View | anychart.data.Set | Array | stringData for the series.
csvSettingsObject.<string, (string|boolean)>If CSV string is passed, you can pass CSV parser settings here as a hash map.

column

Adds Column series.

Params:

NameTypeDescription
dataanychart.data.View | anychart.data.Set | Array | stringData for the series.
csvSettingsObject.<string, (string|boolean)>If CSV string is passed, you can pass CSV parser settings here as a hash map.

getSeries

Getter series by index.

Params:

NameTypeDescription
indexnumber

grid

Getter for chart grid.

Params:

NameTypeDescription
indexstring | numberChart grid index. If not set - creates a new instance and adds it to the end of array.

Returns:

anychart.elements.Grid - Axis instance by index.
Setter for chart grid.

Params:

NameTypeDescription
valueanychart.elements.Grid | ObjectChart grid settings to set.

Returns:

anychart.cartesian.Chart - anychart.cartesian.Chart instance for method chaining.
Setter for chart grid by index.

Params:

NameTypeDescription
indexstring | numberChart grid index.
valueanychart.elements.Grid | Object | string | nullChart grid settings to set.
Note: pass null or 'none' to disable the grid.

Returns:

anychart.cartesian.Chart - anychart.cartesian.Chart class for method chaining.

line

Adds Line series.

Params:

NameTypeDescription
dataanychart.data.View | anychart.data.Set | Array | stringData for the series.
csvSettingsObject.<string, (string|boolean)>If CSV string is passed, you can pass CSV parser settings here as a hash map.

Returns:

anychart.cartesian.series.Base - anychart.cartesian.series.Line instance for method chaining.

lineMarker

Getter for chart line marker.

Params:

NameTypeDescription
indexstring | numberChart line marker index. If not set - creates a new instance and adds it to the end of array.

Returns:

anychart.elements.LineMarker - Line marker instance by index.
Setter for chart line marker.

Params:

NameTypeDescription
valueanychart.elements.LineMarker | ObjectChart line marker settings to set.

Returns:

anychart.cartesian.Chart - anychart.cartesian.Chart instance for method chaining.
Setter for chart line marker by index.

Params:

NameTypeDescription
indexstring | numberChart line marker index.
valueanychart.elements.LineMarker | Object | string | nullChart line marker settings to set.
Note: pass null or 'none' to disable marker.

Returns:

anychart.cartesian.Chart - anychart.cartesian.Chart instance for method chaining.

marker

Adds Marker series.

Params:

NameTypeDescription
dataanychart.data.View | anychart.data.Set | Array | stringData for the series.
csvSettingsObject.<string, (string|boolean)>If CSV string is passed, you can pass CSV parser settings here as a hash map.

minorGrid

Getter for chart minor grid.

Params:

NameTypeDescription
indexstring | numberChart minor grid index. If not set - creates a new instance and adds it to the end of array.

Returns:

anychart.elements.Grid - Axis instance by index.
Setter for chart minor grid.

Params:

NameTypeDescription
valueanychart.elements.Grid | ObjectChart minor grid settings to set.

Returns:

anychart.cartesian.Chart - anychart.cartesian.Chart instance for method chaining.
Setter for chart minor grid by index.

Params:

NameTypeDescription
indexstring | numberChart minor grid index.
valueanychart.elements.Grid | Object | string | nullChart minor grid settings to set.
Note: pass null or 'none' to disable the grid.

Returns:

anychart.cartesian.Chart - anychart.cartesian.Chart instance for method chaining.

ohlc

Adds OHLC series.

Params:

NameTypeDescription
dataanychart.data.View | anychart.data.Set | Array | stringData for the series.
csvSettingsObject.<string, (string|boolean)>If CSV string is passed, you can pass CSV parser settings here as a hash map.

Returns:

anychart.cartesian.series.Base - anychart.cartesian.series.OHLC instance for method chaining.

palette

Getter for series colors palette.
Setter for series colors palette.

Params:

NameTypeDescription
valueanychart.utils.RangeColorPalette | anychart.utils.DistinctColorPalette | ArrayValue to set.

Returns:

anychart.cartesian.Chart - anychart.cartesian.Chart instance for method chaining.

rangeArea

Adds RangeArea series.

Params:

NameTypeDescription
dataanychart.data.View | anychart.data.Set | Array | stringData for the series.
csvSettingsObject.<string, (string|boolean)>If CSV string is passed, you can pass CSV parser settings here as a hash map.

rangeBar

Adds RangeBar series.

Params:

NameTypeDescription
dataanychart.data.View | anychart.data.Set | Array | stringData for the series.
csvSettingsObject.<string, (string|boolean)>If CSV string is passed, you can pass CSV parser settings here as a hash map.

rangeColumn

Adds RangeColumn series.

Params:

NameTypeDescription
dataanychart.data.View | anychart.data.Set | Array | stringData for the series.
csvSettingsObject.<string, (string|boolean)>If CSV string is passed, you can pass CSV parser settings here as a hash map.

rangeMarker

Getter for chart range marker.

Params:

NameTypeDescription
indexstring | numberChart range marker index. If not set - creates a new instance and adds it to the end of array.

Returns:

anychart.elements.RangeMarker - Range marker instance by index.
Setter for chart range marker.

Params:

NameTypeDescription
valueanychart.elements.RangeMarker | ObjectChart range marker settings to set.

Returns:

anychart.cartesian.Chart - anychart.cartesian.Chart instance for method chaining.
Setter for chart range marker by index.

Params:

NameTypeDescription
indexstring | numberChart range marker index.
valueanychart.elements.RangeMarker | Object | string | nullChart range marker settings to set.
Note: pass null or 'none' to disable to disable marker.

Returns:

anychart.cartesian.Chart - anychart.cartesian.Chart instance for method chaining.

rangeSplineArea

Adds RangeSplineArea series.

Params:

NameTypeDescription
dataanychart.data.View | anychart.data.Set | Array | stringData for the series.
csvSettingsObject.<string, (string|boolean)>If CSV string is passed, you can pass CSV parser settings here as a hash map.

rangeStepArea

Adds RangeColumn series.

Params:

NameTypeDescription
dataanychart.data.View | anychart.data.Set | Array | stringData for the series.
csvSettingsObject.<string, (string|boolean)>If CSV string is passed, you can pass CSV parser settings here as a hash map.

spline

Adds Spline series.

Params:

NameTypeDescription
dataanychart.data.View | anychart.data.Set | Array | stringData for the series.
csvSettingsObject.<string, (string|boolean)>If CSV string is passed, you can pass CSV parser settings here as a hash map.

splineArea

Adds SplineArea series.

Params:

NameTypeDescription
dataanychart.data.View | anychart.data.Set | Array | stringData for the series.
csvSettingsObject.<string, (string|boolean)>If CSV string is passed, you can pass CSV parser settings here as a hash map.

stepArea

Adds StepArea series.

Params:

NameTypeDescription
dataanychart.data.View | anychart.data.Set | Array | stringData for the series.
csvSettingsObject.<string, (string|boolean)>If CSV string is passed, you can pass CSV parser settings here as a hash map.

stepLine

Adds StepLine series.

Params:

NameTypeDescription
dataanychart.data.View | anychart.data.Set | Array | stringData for the series.
csvSettingsObject.<string, (string|boolean)>If CSV string is passed, you can pass CSV parser settings here as a hash map.

textMarker

Getter for chart text marker.

Params:

NameTypeDescription
indexstring | numberChart text marker index. If not set - creates a new instance and adds it to the end of array.

Returns:

anychart.elements.TextMarker - Text marker instance by index.
Setter for chart text marker.

Params:

NameTypeDescription
valueanychart.elements.TextMarker | ObjectChart text marker settings to set.

Returns:

anychart.cartesian.Chart - anychart.cartesian.Chart instance for method chaining.
Setter for chart text marker by index.

Params:

NameTypeDescription
indexstring | numberChart text marker index.
valueanychart.elements.TextMarker | Object | string | nullChart text marker settings to set.
Note: pass null or 'none' to disable marker.

Returns:

anychart.cartesian.Chart - anychart.cartesian.Chart instance for method chaining.

xAxis

Getter for chart X-axis.

Params:

NameTypeDescription
indexstring | numberChart axis index. If not set - creates a new instance and adds it to the end of array.

Returns:

anychart.elements.Axis - Axis instance by index.
Setter for chart X-axis.

Params:

NameTypeDescription
valueanychart.elements.Axis | ObjectChart axis settings to set.

Returns:

anychart.cartesian.Chart - anychart.cartesian.Chart instance for method chaining.
Setter for chart X-axis by index.

Params:

NameTypeDescription
indexstring | numberChart axis index.
valueanychart.elements.Axis | Object | string | nullChart axis settings to set.
Note: pass null or 'none' to disable the grid.

Returns:

anychart.cartesian.Chart - anychart.cartesian.Chart instance for method chaining.

xScale

Getter for default chart X scale.

Returns:

anychart.scales.Base - Default chart scale value.
Setter for default chart X scale.
Note: This scale will be passed to all scale dependent chart elements if they don't have their own scales.

Params:

NameTypeDescription
valueanychart.scales.BaseX Scale to set.

Returns:

anychart.cartesian.Chart - anychart.cartesian.Chart instance for method chaining.

yAxis

Getter for chart Y-axis.

Params:

NameTypeDescription
indexstring | numberChart axis index. If not set - creates a new instance and adds it to the end of array.

Returns:

anychart.elements.Axis - Axis instance by index.
Setter for chart Y-axis.

Params:

NameTypeDescription
valueanychart.elements.Axis | ObjectChart axis settings to set.

Returns:

anychart.cartesian.Chart - anychart.cartesian.Chart class for method chaining.
Setter for chart Y-axis by index.

Params:

NameTypeDescription
indexstring | numberChart axis index.
valueanychart.elements.Axis | Object | string | nullChart axis settings to set.
Note: pass null or 'none' to disable the grid.

Returns:

anychart.cartesian.Chart - anychart.cartesian.Chart instance for method chaining.

yScale

Getter for default chart Y scale.

Returns:

anychart.scales.Base - Default chart scale value.
Setter for chart Y scale.
Note: This scale will be passed to all scale dependent chart elements if they don't have their own scales.

Params:

NameTypeDescription
valueanychart.scales.BaseY Scale to set.

Returns:

anychart.cartesian.Chart - anychart.cartesian.Chart instance for method chaining.