#

API Docs for:
Show: Inherited Protected Private Deprecated

# CartesianChart Class

Defined in: `input/charts/CartesianChart.js:1`
Module: charts

The CartesianChart class creates a chart with horizontal and vertical axes.

- Index
- Methods
- Properties
- Attributes
- Events

## Item Index

### Methods

- _addAxes
- _addGridlines
- _addSeries
- _addToAxesCollection
- _addToAxesRenderQueue
- _getAllKeys
- _getAriaMessage
- _getBaseAttribute
- _getBottomOverflow
- _getCategoryAxis
- _getDefaultAxes
- _getDefaultAxisPosition
- _getDefaultSeriesCollection
- _getLeftOverflow
- _getRightOverflow
- _getSeriesAxis
- _getTopOverflow
- _parseAxes
- _parseSeriesAxes
- _parseSeriesCollection
- _planarEventDispatcher
- _redraw
- _setAxes
- _setBaseAttribute
- _sizeChanged
- destructor
- getSeriesItems
- renderUI

### Properties

- _itemRenderQueue
- _type

### Attributes

- allowContentOverflow
- axes
- axesStyles
- bottomAxesCollection
- categoryAxis
- categoryAxisName
- direction
- graphStyles
- horizontalGridlines
- leftAxesCollection
- rightAxesCollection
- seriesCollection
- seriesStyles
- showAreaFill
- showLines
- showMarkers
- stacked
- styles
- topAxesCollection
- type
- valueAxisName
- verticalGridlines

### Events

- planarEvent:mouseout
- planarEvent:mouseover

## Methods

### `_addAxes`

() private

Defined in `input/charts/CartesianChart.js:619`

Adds axes to the chart.

### `_addGridlines`

() private

Defined in `input/charts/CartesianChart.js:690`

Adds gridlines to the chart.

### `_addSeries`

() private

Defined in `input/charts/CartesianChart.js:676`

Renders the Graph.

### `_addToAxesCollection`

(

- `position`
- `axis`

)

Defined in `input/charts/CartesianChart.js:233`

Adds axis instance to the appropriate array based on position

#### Parameters:

- `position` String

  The position of the axis

- `axis` Axis

  The `Axis` instance

### `_addToAxesRenderQueue`

(

- `axis`

)
private

Defined in `input/charts/CartesianChart.js:214`

Adds an `Axis` instance to the `_itemRenderQueue`.

#### Parameters:

- `axis` Axis

  An `Axis` instance.

### `_getAllKeys`

(

- `dp`

)

Defined in `input/charts/CartesianChart.js:763`

Returns all the keys contained in a `dataProvider`.

#### Parameters:

- `dp` Array

  Collection of objects to be parsed.

#### Returns:

Object

### `_getAriaMessage`

(

- `key`

)

Defined in `input/charts/CartesianChart.js:1575`

Returns the appropriate message based on the key press.

#### Parameters:

- `key` Number

  The keycode that was pressed.

#### Returns:

String

### `_getBaseAttribute`

(

- `item`
- `key`

)
private

Defined in `input/charts/CartesianChart.js:456`

Gets an attribute from an object, using a getter for Base objects and a property for object literals. Used for determining attributes from series/axis references which can be an actual class instance or a hash of properties that will be used to create a class instance.

#### Parameters:

- `item` Object

  Object or instance in which the attribute resides.

- `key` String

  Attribute whose value will be returned.

#### Returns:

Object

### `_getBottomOverflow`

(

- `set1`
- `set2`
- `height`

)
private

Defined in `input/charts/CartesianChart.js:1216`

Returns the maximum distance in pixels that the extends outside the bottom bounds of all vertical axes.

#### Parameters:

- `set1` Array

  Collection of axes to check.

- `set2` Array

  Seconf collection of axes to check.

- `height` Number

  Height of the axes

#### Returns:

Number

### `_getCategoryAxis`

() private

Defined in `input/charts/CartesianChart.js:401`

Returns the category axis instance for the chart.

#### Returns:

Axis

### `_getDefaultAxes`

() private

Defined in `input/charts/CartesianChart.js:791`

Default Function for the axes attribute.

#### Returns:

Object

### `_getDefaultAxisPosition`

(

- `axis`
- `valueAxes`
- `position`

)
private

Defined in `input/charts/CartesianChart.js:970`

Determines the position of an axis when one is not specified.

#### Parameters:

- `axis` Axis

  `Axis` instance.

- `valueAxes` Array

  Array of `Axis` instances.

- `position` String

  Default position depending on the direction of the chart and type of axis.

#### Returns:

String

### `_getDefaultSeriesCollection`

(

- `val`

)
private

Defined in `input/charts/CartesianChart.js:251`

Returns the default value for the `seriesCollection` attribute.

#### Parameters:

- `val` Array

  Array containing either `CartesianSeries` instances or objects containing data to construct series instances.

#### Returns:

Array

### `_getLeftOverflow`

(

- `set1`
- `set2`
- `width`

)
private

Defined in `input/charts/CartesianChart.js:1178`

Returns the maximum distance in pixels that the extends outside the left bounds of all horizontal axes.

#### Parameters:

- `set1` Array

  Collection of axes to check.

- `set2` Array

  Seconf collection of axes to check.

- `width` Number

  Width of the axes

#### Returns:

Number

### `_getRightOverflow`

(

- `set1`
- `set2`
- `width`

)
private

Defined in `input/charts/CartesianChart.js:1140`

Returns the maximum distance in pixels that the extends outside the right bounds of all horizontal axes.

#### Parameters:

- `set1` Array

  Collection of axes to check.

- `set2` Array

  Seconf collection of axes to check.

- `width` Number

  Width of the axes

#### Returns:

Number

### `_getSeriesAxis`

(

- `key`

)
private

Defined in `input/charts/CartesianChart.js:417`

Returns the value axis for a series.

#### Parameters:

- `key` String

  The key value used to determine the axis instance.

#### Returns:

Axis

### `_getTopOverflow`

(

- `set1`
- `set2`
- `width`

)
private

Defined in `input/charts/CartesianChart.js:1102`

Returns the maximum distance in pixels that the extends outside the top bounds of all vertical axes.

#### Parameters:

- `set1` Array

  Collection of axes to check.

- `set2` Array

  Seconf collection of axes to check.

- `width` Number

  Width of the axes

#### Returns:

Number

### `_parseAxes`

(

- `axes`

)
private

Defined in `input/charts/CartesianChart.js:803`

Generates and returns a key-indexed object containing `Axis` instances or objects used to create `Axis` instances.

#### Parameters:

- `axes` Object

  Object containing `Axis` instances or `Axis` attributes.

#### Returns:

Object

### `_parseSeriesAxes`

(

- `series`

)
private

Defined in `input/charts/CartesianChart.js:368`

Parse and sets the axes for a series instance.

#### Parameters:

- `series` CartesianSeries

  A `CartesianSeries` instance.

### `_parseSeriesCollection`

(

- `val`

)
private

Defined in `input/charts/CartesianChart.js:264`

Parses and returns a series collection from an object and default properties.

#### Parameters:

- `val` Object

  Object contain properties for series being set.

#### Returns:

Object

### `_planarEventDispatcher`

(

- `e`

)
private

Defined in `input/charts/CartesianChart.js:48`

When `interactionType` is set to `planar`, listens for mouse move events and fires `planarEvent:mouseover` or `planarEvent:mouseout` depending on the position of the mouse in relation to data points on the `Chart`.

#### Parameters:

- `e` Object

  Event object.

### `_redraw`

() private

Defined in `input/charts/CartesianChart.js:1254`

Redraws and position all the components of the chart instance.

### `_setAxes`

(

- `val`

)
private

Defined in `input/charts/CartesianChart.js:503`

Creates `Axis` instances.

#### Parameters:

- `val` Object

  Object containing `Axis` instances or objects in which to construct `Axis` instances.

#### Returns:

Object

### `_setBaseAttribute`

(

- `item`
- `key`
- `value`

)
private

Defined in `input/charts/CartesianChart.js:480`

Sets an attribute on an object, using a setter of Base objects and a property for object literals. Used for setting attributes on a Base class, either directly or to be stored in an object literal for use at instantiation.

#### Parameters:

- `item` Object

  Object or instance in which the attribute resides.

- `key` String

  Attribute whose value will be assigned.

- `value` Object

  Value to be assigned to the attribute.

### `_sizeChanged`

(

- `e`

)
private

Defined in `input/charts/CartesianChart.js:1080`

Handler for sizeChanged event.

#### Parameters:

- `e` Object

  Event object.

### `destructor`

() protected

Defined in `input/charts/CartesianChart.js:1518`

Destructor implementation for the CartesianChart class. Calls destroy on all axes, series and the Graph instance. Removes the tooltip and overlay HTML elements.

### `getSeriesItems`

(

- `series`
- `index`

)

Defined in `input/charts/CartesianChart.js:1014`

Returns an object literal containing a categoryItem and a valueItem for a given series index. Below is the structure of each:

#### Parameters:

- `series` CartesianSeries

  Reference to a series.

- `index` Number

  Index of the specified item within a series.

#### Returns:

Object An object literal containing the following:

categoryItem
  Object containing the following data related to the category axis of the series.
  axis
    Reference to the category axis of the series.
  key
    Category key for the series.
  value
    Value on the axis corresponding to the series index.
valueItem
  Object containing the following data related to the category axis of the series.
  axis
    Reference to the value axis of the series.
  key
    Value key for the series.
  value
    Value on the axis corresponding to the series index.

### `renderUI`

() private

Defined in `input/charts/CartesianChart.js:10`

## Properties

### `_itemRenderQueue`

Array private

Defined in `input/charts/CartesianChart.js:205`

Queue of axes instances that will be updated. This method is used internally to determine when all axes have been updated.

### `_type`

String private

Defined in `input/charts/CartesianChart.js:196`

Indicates the default series type for the chart.

## Attributes

### `allowContentOverflow`

Boolean

Defined in `input/charts/CartesianChart.js:1658`

Indicates whether axis labels are allowed to overflow beyond the bounds of the chart's content box.

### `axes`

Object

Defined in `input/charts/CartesianChart.js:1866`

Axes to appear in the chart. This can be a key indexed hash of axis instances or object literals used to construct the appropriate axes.

### `axesStyles`

Object private

Defined in `input/charts/CartesianChart.js:1668`

Style object for the axes.

### `bottomAxesCollection`

Array private

Defined in `input/charts/CartesianChart.js:1907`

Reference to the bottom-aligned axes for the chart.

### `categoryAxis`

Axis

Defined in `input/charts/CartesianChart.js:2123`

Reference to the category axis used by the chart.

### `categoryAxisName`

String

Defined in `input/charts/CartesianChart.js:1998`

Indicates the key value used to identify a category axis in the `axes` hash. If not specified, the categoryKey attribute value will be used.

### `direction`

String

Defined in `input/charts/CartesianChart.js:1944`

Direction of chart's category axis when there is no series collection specified. Charts can be horizontal or vertical. When the chart type is column, the chart is horizontal. When the chart type is bar, the chart is vertical.

### `graphStyles`

Object private

Defined in `input/charts/CartesianChart.js:1775`

Styles for the graph.

### `horizontalGridlines`

Gridlines

Defined in `input/charts/CartesianChart.js:2018`

Reference to the horizontalGridlines for the chart.

### `leftAxesCollection`

Array private

Defined in `input/charts/CartesianChart.js:1898`

Reference to the left-aligned axes for the chart.

### `rightAxesCollection`

Array private

Defined in `input/charts/CartesianChart.js:1916`

Reference to the right-aligned axes for the chart.

### `seriesCollection`

Array

Defined in `input/charts/CartesianChart.js:1882`

Collection of series to appear on the chart. This can be an array of Series instances or object literals used to construct the appropriate series.

### `seriesStyles`

Object private

Defined in `input/charts/CartesianChart.js:1712`

Style object for the series

### `showAreaFill`

Boolean

Defined in `input/charts/CartesianChart.js:1974`

Indicates whether or not an area is filled in a combo chart.

### `showLines`

Boolean

Defined in `input/charts/CartesianChart.js:1990`

Indicates whether to display lines in a combo chart.

### `showMarkers`

Boolean

Defined in `input/charts/CartesianChart.js:1982`

Indicates whether to display markers in a combo chart.

### `stacked`

Boolean

Defined in `input/charts/CartesianChart.js:1934`

Indicates whether or not the chart is stacked.

### `styles`

Object

Defined in `input/charts/CartesianChart.js:1801`

Style properties for the chart. Contains a key indexed hash of the following:

series
  A key indexed hash containing references to the `styles` attribute for each series in the chart. Specific style attributes vary depending on the series:
  - AreaSeries
  - BarSeries
  - ColumnSeries
  - ComboSeries
  - LineSeries
  - MarkerSeries
  - SplineSeries
axes
  A key indexed hash containing references to the `styles` attribute for each axes in the chart. Specific style attributes can be found in the Axis class.
graph
  A reference to the `styles` attribute in the chart. Specific style attributes can be found in the Graph class.

### `topAxesCollection`

Array private

Defined in `input/charts/CartesianChart.js:1925`

Reference to the top-aligned axes for the chart.

### `type`

String

Defined in `input/charts/CartesianChart.js:2086`

Type of chart when there is no series collection specified.

### `valueAxisName`

String

Defined in `input/charts/CartesianChart.js:2008`

Indicates the key value used to identify a the series axis when an axis not generated.

### `verticalGridlines`

Gridlines

Defined in `input/charts/CartesianChart.js:2052`

Reference to the verticalGridlines for the chart.

## Events

### `planarEvent:mouseout`

Defined in `input/charts/CartesianChart.js:168`

Broadcasts when `interactionType` is set to `planar` and a series' marker plane has received a mouseout event.

#### Event Payload:

- `e` EventFacade

### `planarEvent:mouseover`

Defined in `input/charts/CartesianChart.js:148`

Broadcasts when `interactionType` is set to `planar` and a series' marker plane has received a mouseover event.

#### Event Payload:

- `e` EventFacade

  Event facade with the following additional properties:

  categoryItem
    An array of hashes, each containing information about the category `Axis` of each marker whose plane has been intersected.
  valueItem
    An array of hashes, each containing information about the value `Axis` of each marker whose plane has been intersected.
  x
    The x-coordinate of the mouse in relation to the Chart.
  y
    The y-coordinate of the mouse in relation to the Chart.
  pageX
    The x location of the event on the page (including scroll)
  pageY
    The y location of the event on the page (including scroll)
  items
    An array including all the series which contain a marker whose plane has been intersected.
  index
    Index of the markers in their respective series.
  originEvent
    Underlying dom event.