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

namespace anychart Improve this Doc

Core space for all anychart components.

Constants Overview

DEVELOPDefines if it is developer edition.
VERSIONCurrent version of the framework.

Functions Overview

area()Creates and returns an Area Chart.
area3d()Creates and returns an Area 3D Chart.
bar()Creates and returns a Bar Chart.
bar3d()Creates and returns a Bar 3D Chart.
box()Creates and returns a Box Chart.
bubble()Creates and returns a Bubble Chart.
bubbleMap()Creates and returns a Bubble Map.
bullet()Creates and returns a Bullet Chart.
cartesian()Creates and returns a Cartesian chart.
cartesian3d()Creates and returns a Cartesian 3D chart.
choropleth()Creates and returns a Choropleth Map.
circularGauge()Creates and returns a Circular Gauge.
column()Creates and returns a Column Chart.
column3d()Creates and returns an Column 3D Chart.
financial()Creates and returns a Financial Chart.
fromJson()Creates an element by JSON config.
fromXml()Creates an element by XML config.
funnel()Creates and returns a Funnel Chart.
ganttProject()Creates and returns a Gantt Project Chart.
ganttResource()Creates and returns a Gantt Resource Chart.
ganttToolbar()Constructor function for gantt toolbar.
heatMap()Creates and returns a Heat Map.
licenseKey()Setter for AnyChart license key.
line()Creates and returns a Line Chart.
map()Creates and returns a Map.
marker()Creates and returns a Marker Chart.
onDocumentLoad()Add callback for the document load event.
onDocumentReady()Add callback for document ready event.
pie()Creates and returns a Pie Chart.
pie3d()Creates and returns a 3D Pie Chart.
polar()Creates and returns a Polar Chart.
pyramid()Creates and returns a Pyramid Chart.
radar()Creates and returns a Radar chart.
scatter()Creates and returns a Scatter Chart.
server()Sets an address export server script, which is used to export to an image or PDF.
sparkline()Creates and returns a Sparkline Chart.
stock()Creates and returns a Stock Chart.
theme()Sets the theme for anychart globally or gets current theme.
toolbar()Constructor function for default toolbar.

Classes Overview

anychart.SignalEventSpecial event for changes in dirty states.

Constants Description

Defines if it is developer edition.

Type: boolean

Current version of the framework.

Type: string

Functions Description

area

Creates and returns an Area Chart. Each passed parameter is considered as a set of data which is to become a base for the Area Series. To create an Area Chart with no predefined settings, see anychart#cartesian

Params:

NameTypeDescription
var_argsanychart.data.View | anychart.data.Set | ArrayArea chart data.

Returns:

anychart.charts.Cartesian - Chart with defaults for area series.

area3d

Creates and returns an Area 3D Chart. Each passed parameter is considered as a set of data which is to become a base for the Area Series.

Params:

NameTypeDescription
var_argsanychart.data.View | anychart.data.Set | ArrayArea chart data.

Returns:

anychart.charts.Cartesian3d - Chart with defaults for area series.

bar

Creates and returns a Bar Chart. Each passed parameter is considered as a set of data which is to become a base for the Bar Series. To create an Bar Chart with no predefined settings, see anychart#cartesian

Params:

NameTypeDescription
var_argsanychart.data.View | anychart.data.Set | ArrayBar chart data.

Returns:

anychart.charts.Cartesian - Chart with defaults for bar series.

bar3d

Creates and returns a Bar 3D Chart. Each passed parameter is considered as a set of data which is to become a base for the Bar Series.

Params:

NameTypeDescription
var_argsanychart.data.View | anychart.data.Set | ArrayBar chart data.

Returns:

anychart.charts.Cartesian3d - Chart with defaults for bar series.

box

Creates and returns a Box Chart. Each passed parameter is considered as a set of data which is to become a base for the Box Series. To create an Box Chart with no predefined settings, see anychart#cartesian

Params:

NameTypeDescription
var_argsanychart.data.View | anychart.data.Set | ArrayBox chart data.

Returns:

anychart.charts.Cartesian - Chart with defaults for box series.

bubble

Creates and returns a Bubble Chart. Each passed parameter is considered as a set of data which is to become a base for the Bubble Series. To create an Bubble Chart with no predefined settings, see anychart#scatter

Params:

NameTypeDescription
var_argsanychart.data.View | anychart.data.Set | ArrayBubble chart data.

Returns:

anychart.charts.Scatter - Chart with defaults for bubble series.

bubbleMap

Creates and returns a Bubble Map.

Params:

NameTypeDescription
var_argsanychart.data.View | anychart.data.Set | ArrayData for creating a Bubble Map.

Returns:

anychart.charts.Map - New map instance with a set of predefined settings suitable for bubble series.

bullet

Creates and returns a Bullet Chart.

Params:

NameTypeDescription
dataanychart.data.View | anychart.data.Set | Array | stringBullet Chart data.

Returns:

anychart.charts.Bullet - Bullet chart.

cartesian

Creates and returns a Cartesian chart. Has no predefined settings such as axes, grids, legends settings, etc.

Params:

NameTypeDescription
barChartModebooleanIf true, sets the chart to Bar Chart mode, swapping default chart elements behaviour to horizontal-oriented (setting default layout to VERTICAL, swapping axes, etc).

Returns:

anychart.charts.Cartesian - Empty chart.

cartesian3d

Creates and returns a Cartesian 3D chart. Has no predefined settings such as grids, legends, titles settings, etc.

Params:

NameTypeDescription
barChartModebooleanIf true, sets the chart to Bar Chart mode, swapping default chart elements behaviour to horizontal-oriented (setting default layout to VERTICAL, swapping axes, etc).

Returns:

anychart.charts.Cartesian3d - Empty chart.

choropleth

Creates and returns a Choropleth Map.

Params:

NameTypeDescription
var_argsanychart.data.View | anychart.data.Set | ArrayData for creating a Choropleth Map.

Returns:

anychart.charts.Map - New map instance with a set of predefined settings suitable for choropleth series.

circularGauge

Creates and returns a Circular Gauge.

Params:

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

Returns:

anychart.gauges.Circular - Circular gauge with defaults.

column

Creates and returns a Column Chart. Each passed parameter is considered as a set of data which is to become a base for the Column Series. To create an Column Chart with no predefined settings, see anychart#cartesian

Params:

NameTypeDescription
var_argsanychart.data.View | anychart.data.Set | ArrayColumn chart data.

Returns:

anychart.charts.Cartesian - Chart with defaults for column series.

column3d

Creates and returns an Column 3D Chart. Each passed parameter is considered as a set of data which is to become a base for the Column Series.

Params:

NameTypeDescription
var_argsanychart.data.View | anychart.data.Set | ArrayColumn chart data.

Returns:

anychart.charts.Cartesian3d - Chart with defaults for column series.

financial

Creates and returns a Financial Chart. Each passed parameter is considered as a set of data which is to become a base for the Financial Series. To create an Financial Chart with no predefined settings, see anychart#cartesian

Params:

NameTypeDescription
var_argsanychart.data.View | anychart.data.Set | ArrayFinance chart data.

Returns:

anychart.charts.Cartesian - Chart with defaults for ohlc and candlestick series.

fromJson

Creates an element by JSON config.

Params:

NameTypeDescription
jsonConfigObject | stringConfig.

Returns:

* - Element created by config.

fromXml

Creates an element by XML config.

Params:

NameTypeDescription
xmlConfigstring | NodeConfig.

Returns:

* - Element created by config.

funnel

Creates and returns a Funnel Chart. Contains the predefined settings for the tooltip.

Params:

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

ganttProject

Creates and returns a Gantt Project Chart.

Returns:

anychart.charts.Gantt - Gantt Project Chart

ganttResource

Creates and returns a Gantt Resource Chart.

Returns:

anychart.charts.Gantt - Gantt Resource Chart

ganttToolbar

Constructor function for gantt toolbar.

heatMap

Creates and returns a Heat Map.
Note: Contains predefined settings for axes and grids.

Params:

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

Returns:

anychart.charts.HeatMap - Heat map chart.

licenseKey

Setter for AnyChart license key.
To purchase a license proceed to Buy AnyChart page.

Params:

NameTypeDescription
valuestringYour licence key.

Returns:

string - Current licence key.

line

Creates and returns a Line Chart. Each passed parameter is considered as a set of data which is to become a base for the Line Series. To create an Line Chart with no predefined settings, see anychart#cartesian

Params:

NameTypeDescription
var_argsanychart.data.View | anychart.data.Set | ArrayLine chart data.

Returns:

anychart.charts.Cartesian - Chart with defaults for line series.

map

Creates and returns a Map.

Returns:

anychart.charts.Map - Map.

marker

Creates and returns a Marker Chart. Each passed parameter is considered as a set of data which is to become a base for the Marker Series. To create an Marker Chart with no predefined settings, see anychart#scatter

Params:

NameTypeDescription
var_argsanychart.data.View | anychart.data.Set | ArrayMarker chart data.

Returns:

anychart.charts.Scatter - Chart with defaults for marker series.

onDocumentLoad

Add callback for the document load event.
It is fired when the entire page loads, including its content (images, css, scripts, etc.).

Params:

NameTypeDescription
funcfunctionFunction which will be called on document load event.
scope*Function call context.

onDocumentReady

Add callback for document ready event.
It is called when the DOM is ready, this can happen prior to images and other external content is loaded.

Params:

NameTypeDescription
funcfunctionFunction which will called on document load event.
scope*Function call context.

pie

Creates and returns a Pie Chart.

Params:

NameTypeDescription
dataanychart.data.View | anychart.data.Set | Array | stringData for the chart.

Returns:

anychart.charts.Pie - Default pie chart.

pie3d

Creates and returns a 3D Pie Chart.

Params:

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

Returns:

anychart.charts.Pie - Chart with defaults for 3D Pie.

polar

Creates and returns a Polar Chart.

Params:

NameTypeDescription
var_argsanychart.data.View | anychart.data.Set | ArrayMarker chart data.

Returns:

anychart.charts.Polar - Chart with defaults for marker series.

pyramid

Creates and returns a Pyramid Chart. Contains the predefined settings for the tooltip.

Params:

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

radar

Creates and returns a Radar chart.

Params:

NameTypeDescription
var_argsanychart.data.View | anychart.data.Set | ArrayLine chart data.

Returns:

anychart.charts.Radar - Chart with defaults for line series.

scatter

Creates and returns a Scatter Chart. By default creates marker series if arguments is set.

Params:

NameTypeDescription
var_argsanychart.data.View | anychart.data.Set | ArrayMarker chart data.

Returns:

anychart.charts.Scatter - Chart with defaults for scatter series.

server

Sets an address export server script, which is used to export to an image or PDF.
See:
  • anychart.graphics.vector.Stage#saveAsPdf
  • anychart.graphics.vector.Stage#saveAsPng
  • anychart.graphics.vector.Stage#saveAsJpg
  • anychart.graphics.vector.Stage#saveAsSvg
  • Params:

    NameTypeDescription
    addressstringExport server script URL.

    sparkline

    Creates and returns a Sparkline Chart.

    Params:

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

    Returns:

    anychart.charts.Sparkline - Chart with defaults for marker series.

    stock

    Creates and returns a Stock Chart.

    Returns:

    anychart.charts.Stock - New stock chart instance.

    theme

    Sets the theme for anychart globally or gets current theme. Learn more about themes.

    Params:

    NameTypeDefaultDescription
    valuestring | Object
    "defaultTheme"
    Object with theme settings or name of the theme.

    toolbar

    Constructor function for default toolbar.