Top
You are looking at an outdated 7.2.0 version of this document. Switch to the 8.0.1 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:

Name Type Description
data anychart.data.View | anychart.data.Set | Array Data for the series.
csvSettings Object.<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.

Try it:

bar

Adds Bar series.

Params:

Name Type Description
data anychart.data.View | anychart.data.Set | Array | string Data for the series.
csvSettings Object.<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.

Try it:

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:

Name Type Default Description
value number
0.1
Value to set.

Returns:

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

Try it:

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:

Name Type Default Description
value number
0.1
Value to set.

Returns:

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

Try it:

bubble

Adds Bubble series.

Params:

Name Type Description
data anychart.data.View | anychart.data.Set | Array | string Data for the series.
csvSettings Object.<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.Bubble instance for method chaining.

Try it:

candlestick

Adds Candlestick series.

Params:

Name Type Description
data anychart.data.View | anychart.data.Set | Array | string Data for the series.
csvSettings Object.<string, (string|boolean)> If CSV string is passed, you can pass CSV parser settings here as a hash map.

Try it:

column

Adds Column series.

Params:

Name Type Description
data anychart.data.View | anychart.data.Set | Array | string Data for the series.
csvSettings Object.<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.Column instance for method chaining.

Try it:

getSeries

Getter series by index.

Params:

Name Type Description
index number

Try it:

grid

Getter for chart grid.

Params:

Name Type Description
index string | number Chart 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.

Try it:

Setter for chart grid.

Params:

Name Type Description
value anychart.elements.Grid | Object Chart grid settings to set.

Returns:

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

Try it:

Setter for chart grid by index.

Params:

Name Type Description
index string | number Chart grid index.
value anychart.elements.Grid | Object | string | null Chart grid settings to set.
Note: pass null or 'none' to disable the grid.

Returns:

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

Try it:

line

Adds Line series.

Params:

Name Type Description
data anychart.data.View | anychart.data.Set | Array | string Data for the series.
csvSettings Object.<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.

Try it:

lineMarker

Getter for chart line marker.

Params:

Name Type Description
index string | number Chart 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:

Name Type Description
value anychart.elements.LineMarker | Object Chart line marker settings to set.

Returns:

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

Try it:

Setter for chart line marker by index.

Params:

Name Type Description
index string | number Chart line marker index.
value anychart.elements.LineMarker | Object | string | null Chart line marker settings to set.
Note: pass null or 'none' to disable marker.

Returns:

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

Try it:

marker

Adds Marker series.

Params:

Name Type Description
data anychart.data.View | anychart.data.Set | Array | string Data for the series.
csvSettings Object.<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.Marker instance for method chaining.

Try it:

minorGrid

Getter for chart minor grid.

Params:

Name Type Description
index string | number Chart 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.

Try it:

Setter for chart minor grid.

Params:

Name Type Description
value anychart.elements.Grid | Object Chart minor grid settings to set.

Returns:

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

Try it:

Setter for chart minor grid by index.

Params:

Name Type Description
index string | number Chart minor grid index.
value anychart.elements.Grid | Object | string | null Chart 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.

Try it:

ohlc

Adds OHLC series.

Params:

Name Type Description
data anychart.data.View | anychart.data.Set | Array | string Data for the series.
csvSettings Object.<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.

Try it:

palette

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

Params:

Name Type Description
value anychart.utils.RangeColorPalette | anychart.utils.DistinctColorPalette | Array Value to set.

Returns:

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

Try it:

rangeArea

Adds RangeArea series.

Params:

Name Type Description
data anychart.data.View | anychart.data.Set | Array | string Data for the series.
csvSettings Object.<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.RangeArea instance for method chaining.

Try it:

rangeBar

Adds RangeBar series.

Params:

Name Type Description
data anychart.data.View | anychart.data.Set | Array | string Data for the series.
csvSettings Object.<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.RangeBar instance for method chaining.

Try it:

rangeColumn

Adds RangeColumn series.

Params:

Name Type Description
data anychart.data.View | anychart.data.Set | Array | string Data for the series.
csvSettings Object.<string, (string|boolean)> If CSV string is passed, you can pass CSV parser settings here as a hash map.

Try it:

rangeMarker

Getter for chart range marker.

Params:

Name Type Description
index string | number Chart 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:

Name Type Description
value anychart.elements.RangeMarker | Object Chart range marker settings to set.

Returns:

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

Try it:

Setter for chart range marker by index.

Params:

Name Type Description
index string | number Chart range marker index.
value anychart.elements.RangeMarker | Object | string | null Chart 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.

Try it:

rangeSplineArea

Adds RangeSplineArea series.

Params:

Name Type Description
data anychart.data.View | anychart.data.Set | Array | string Data for the series.
csvSettings Object.<string, (string|boolean)> If CSV string is passed, you can pass CSV parser settings here as a hash map.

Try it:

rangeStepArea

Adds RangeColumn series.

Params:

Name Type Description
data anychart.data.View | anychart.data.Set | Array | string Data for the series.
csvSettings Object.<string, (string|boolean)> If CSV string is passed, you can pass CSV parser settings here as a hash map.

Try it:

spline

Adds Spline series.

Params:

Name Type Description
data anychart.data.View | anychart.data.Set | Array | string Data for the series.
csvSettings Object.<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.Spline instance for method chaining.

Try it:

splineArea

Adds SplineArea series.

Params:

Name Type Description
data anychart.data.View | anychart.data.Set | Array | string Data for the series.
csvSettings Object.<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.SplineArea instance for method chaining.

Try it:

stepArea

Adds StepArea series.

Params:

Name Type Description
data anychart.data.View | anychart.data.Set | Array | string Data for the series.
csvSettings Object.<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.StepArea instance for method chaining.

Try it:

stepLine

Adds StepLine series.

Params:

Name Type Description
data anychart.data.View | anychart.data.Set | Array | string Data for the series.
csvSettings Object.<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.StepLine instance for method chaining.

Try it:

textMarker

Getter for chart text marker.

Params:

Name Type Description
index string | number Chart 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:

Name Type Description
value anychart.elements.TextMarker | Object Chart text marker settings to set.

Returns:

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

Try it:

Setter for chart text marker by index.

Params:

Name Type Description
index string | number Chart text marker index.
value anychart.elements.TextMarker | Object | string | null Chart text marker settings to set.
Note: pass null or 'none' to disable marker.

Returns:

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

Try it:

xAxis

Getter for chart X-axis.

Params:

Name Type Description
index string | number Chart 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:

Name Type Description
value anychart.elements.Axis | Object Chart axis settings to set.

Returns:

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

Try it:

Setter for chart X-axis by index.

Params:

Name Type Description
index string | number Chart axis index.
value anychart.elements.Axis | Object | string | null Chart axis settings to set.
Note: pass null or 'none' to disable the grid.

Returns:

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

Try it:

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:

Name Type Description
value anychart.scales.Base X Scale to set.

Returns:

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

Try it:

yAxis

Getter for chart Y-axis.

Params:

Name Type Description
index string | number Chart 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:

Name Type Description
value anychart.elements.Axis | Object Chart axis settings to set.

Returns:

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

Try it:

Setter for chart Y-axis by index.

Params:

Name Type Description
index string | number Chart axis index.
value anychart.elements.Axis | Object | string | null Chart axis settings to set.
Note: pass null or 'none' to disable the grid.

Returns:

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

Try it:

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:

Name Type Description
value anychart.scales.Base Y Scale to set.

Returns:

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

Try it: