Top
You are looking at an outdated 7.5.0 version of this document. Switch to the 7.14.3 version to see the up to date information.

class anychart.charts.Cartesian Improve this Doc

Extends: anychart.core.SeparateChart

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.
box()Adds Box series.
bubble()Adds Bubble series.
candlestick()Adds Candlestick series.
column()Adds Column series.
getSeries()Getter series by index.
getType()Returns chart type.
grid()Getter for chart grid.
hatchFillPalette()Chart hatch fill palette settings.
line()Adds Line series.
lineMarker()Getter for chart line marker.
marker()Adds Marker series.
markerPalette()Chart markers palette settings.
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.core.cartesian.series.Area - An instance of class 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.core.cartesian.series.Bar - An instance of class 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.charts.Cartesian#barsPadding.

Params:

Name Type Default Description
value number
0.1
Value to set.

Returns:

anychart.charts.Cartesian - Self 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.charts.Cartesian - Self instance for method chaining.

Try it:

box

Adds Box 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.core.cartesian.series.Box - An instance of class 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.core.cartesian.series.Bubble - An instance of class 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.

Returns:

anychart.core.cartesian.series.Candlestick - An instance of class for method chaining.

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.core.cartesian.series.Column - An instance of class for method chaining.

Try it:

getSeries

Getter series by index.

Params:

Name Type Description
index number

Try it:

getType

Returns chart type.

Returns:

anychart.enums.ChartTypes - Current chart type.

Try it:

grid

Getter for chart grid.

Params:

Name Type Description
index number Chart grid index. If not set - creates a new instance and adds it to the end of array.

Returns:

anychart.core.grids.Linear - Axis instance by index.

Try it:

Setter for chart grid.

Params:

Name Type Description
value Object | boolean | null Chart grid settings to set.

Returns:

anychart.charts.Cartesian - Self instance for method chaining.

Try it:

Setter for chart grid by index.

Params:

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

Returns:

anychart.charts.Cartesian - Self instance for method chaining.

Try it:

hatchFillPalette

Chart hatch fill palette settings.

Params:

Name Type Description
value Array.<anychart.graphics.vector.HatchFill.HatchFillType> | Object | anychart.palettes.HatchFills Chart hatch fill palette settings to set.

Returns:

anychart.palettes.HatchFills anychart.charts.Cartesian - Return current chart hatch fill palette or itself for chaining call.

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.core.cartesian.series.Line - An instance of class for method chaining.

Try it:

lineMarker

Getter for chart line marker.

Params:

Name Type Description
index number Chart line marker index. If not set - creates a new instance and adds it to the end of array.

Returns:

anychart.core.axisMarkers.Line - Line marker instance by index.

Try it:

Setter for chart line marker.

Params:

Name Type Description
value Object | boolean | null Chart line marker settings to set.

Returns:

anychart.charts.Cartesian - Self instance for method chaining.

Try it:

Setter for chart line marker by index.

Params:

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

Returns:

anychart.charts.Cartesian - Self 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.core.cartesian.series.Marker - An instance of class for method chaining.

Try it:

markerPalette

Chart markers palette settings.

Params:

Name Type Description
value anychart.palettes.Markers | Object | Array.<anychart.enums.MarkerType> Chart marker palette settings to set.

Returns:

anychart.palettes.Markers anychart.charts.Cartesian - Return current chart markers palette or itself for chaining call.

minorGrid

Getter for chart minor grid.

Params:

Name Type Description
index number Chart minor grid index. If not set - creates a new instance and adds it to the end of array.

Returns:

anychart.core.grids.Linear - Axis instance by index.

Try it:

Setter for chart minor grid.

Params:

Name Type Description
value Object | boolean | null Chart minor grid settings to set.

Returns:

anychart.charts.Cartesian - Self instance for method chaining.

Try it:

Setter for chart minor grid by index.

Params:

Name Type Description
index number Chart minor grid index.
value Object | boolean | null Chart minor grid settings to set.
Note: pass null or 'none' to disable the grid.

Returns:

anychart.charts.Cartesian - Self 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.core.cartesian.series.OHLC - An instance of class for method chaining.

Try it:

palette

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

Params:

Name Type Description
value anychart.palettes.RangeColors | anychart.palettes.DistinctColors | Object | Array.<string> Value to set.

Returns:

anychart.charts.Cartesian - Self 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.core.cartesian.series.RangeArea - An instance of class 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.core.cartesian.series.RangeBar - An instance of class 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.

Returns:

anychart.core.cartesian.series.RangeColumn - An instance of class for method chaining.

Try it:

rangeMarker

Getter for chart range marker.

Params:

Name Type Description
index number Chart range marker index. If not set - creates a new instance and adds it to the end of array.

Returns:

anychart.core.axisMarkers.Range - Range marker instance by index.

Try it:

Setter for chart range marker.

Params:

Name Type Description
value anychart.core.axisMarkers.Range | Object Chart range marker settings to set.

Returns:

anychart.charts.Cartesian - Self instance for method chaining.

Try it:

Setter for chart range marker by index.

Params:

Name Type Description
index number Chart range marker index.
value Object | boolean | null Chart range marker settings to set.
Note: pass null or 'none' to disable to disable marker.

Returns:

anychart.charts.Cartesian - Self 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.

Returns:

anychart.core.cartesian.series.RangeSplineArea - An instance of class for method chaining.

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.

Returns:

anychart.core.cartesian.series.RangeColumn - An instance of class for method chaining.

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.core.cartesian.series.Spline - An instance of class 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.core.cartesian.series.SplineArea - An instance of class 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.core.cartesian.series.StepArea - An instance of class 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.core.cartesian.series.StepLine - An instance of class for method chaining.

Try it:

textMarker

Getter for chart text marker.

Params:

Name Type Description
index number Chart text marker index. If not set - creates a new instance and adds it to the end of array.

Returns:

anychart.core.axisMarkers.Text - Text marker instance by index.

Try it:

Setter for chart text marker.

Params:

Name Type Description
value Object | boolean | null Chart text marker settings to set.

Returns:

anychart.charts.Cartesian - Self instance for method chaining.

Try it:

Setter for chart text marker by index.

Params:

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

Returns:

anychart.charts.Cartesian - Self instance for method chaining.

Try it:

xAxis

Getter for chart X-axis.

Params:

Name Type Description
index number Chart axis index. If not set - creates a new instance and adds it to the end of array.

Returns:

anychart.core.axes.Linear - Axis instance by index.

Try it:

Setter for chart X-axis.

Params:

Name Type Description
value Object | boolean | null Chart axis settings to set.

Returns:

anychart.charts.Cartesian - Self instance for method chaining.

Try it:

Setter for chart X-axis by index.

Params:

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

Returns:

anychart.charts.Cartesian - Self 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.enums.ScaleTypes | anychart.scales.Base X Scale to set.

Returns:

anychart.charts.Cartesian - Self instance for method chaining.

Try it:

yAxis

Getter for chart Y-axis.

Params:

Name Type Description
index number Chart axis index. If not set - creates a new instance and adds it to the end of array.

Returns:

anychart.core.axes.Linear - Axis instance by index.

Try it:

Setter for chart Y-axis.

Params:

Name Type Description
value Object | boolean | null Chart axis settings to set.

Returns:

anychart.charts.Cartesian - Self instance for method chaining.

Try it:

Setter for chart Y-axis by index.

Params:

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

Returns:

anychart.charts.Cartesian - Self instance for method chaining.

Try it:

yScale

Getter for default chart Y scale.

Returns:

anychart.scales.Base - Default chart scale value.

Try it:

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.enums.ScaleTypes | anychart.scales.Base Y Scale to set.

Returns:

anychart.charts.Cartesian - Self instance for method chaining.

Try it: