API Docs for: 3.8.0
Show:

CartesianChart Class

Module: charts-base
Parent Module: charts

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

Methods

_addAxes

() private

Adds axes to the chart.

_addGridlines

() private

Adds gridlines to the chart.

_addSeries

() private

Renders the Graph.

_addToAxesCollection

(
  • position
  • axis
)

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

Adds an Axis instance to the _itemRenderQueue.

Parameters:

  • axis Axis

    An Axis instance.

_getAriaMessage

(
  • key
)

Returns the appropriate message based on the key press.

Parameters:

  • key Number

    The keycode that was pressed.

Returns:

String

_getBaseAttribute

(
  • item
  • key
)
private

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

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

Returns the category axis instance for the chart.

Returns:

Axis

_getDefaultAxes

() private

Default Function for the axes attribute.

Returns:

Object

_getDefaultAxisPosition

(
  • axis
  • valueAxes
  • position
)
private

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

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

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

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

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

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

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

Parse and sets the axes for a series instance.

Parameters:

_parseSeriesCollection

(
  • val
)
private

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

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:

_redraw

() private

Redraws and position all the components of the chart instance.

_setAxes

(
  • val
)
private

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

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

Handler for sizeChanged event.

Parameters:

destructor

() protected

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
)

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

Properties

_itemRenderQueue

Array private

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

_type

String private

Indicates the default series type for the chart.

Attributes

allowContentOverflow

Boolean

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

Fires event allowContentOverflowChange

Fires when the value for the configuration attribute allowContentOverflow is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.

Parameters:

  • e EventFacade
    An Event Facade object with the following attribute-specific properties added:
    • prevVal Any
      The value of the attribute, prior to it being set.
    • newVal Any
      The value the attribute is to be set to.
    • attrName String
      The name of the attribute being set.
    • subAttrName String
      If setting a property within the attribute's value, the name of the sub-attribute property being set.

axes

Object

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.

Fires event axesChange

Fires when the value for the configuration attribute axes is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.

Parameters:

  • e EventFacade
    An Event Facade object with the following attribute-specific properties added:
    • prevVal Any
      The value of the attribute, prior to it being set.
    • newVal Any
      The value the attribute is to be set to.
    • attrName String
      The name of the attribute being set.
    • subAttrName String
      If setting a property within the attribute's value, the name of the sub-attribute property being set.

axesStyles

Object private

Style object for the axes.

Fires event axesStylesChange

Fires when the value for the configuration attribute axesStyles is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.

Parameters:

  • e EventFacade
    An Event Facade object with the following attribute-specific properties added:
    • prevVal Any
      The value of the attribute, prior to it being set.
    • newVal Any
      The value the attribute is to be set to.
    • attrName String
      The name of the attribute being set.
    • subAttrName String
      If setting a property within the attribute's value, the name of the sub-attribute property being set.

bottomAxesCollection

Array private

Reference to the bottom-aligned axes for the chart.

Fires event bottomAxesCollectionChange

Fires when the value for the configuration attribute bottomAxesCollection is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.

Parameters:

  • e EventFacade
    An Event Facade object with the following attribute-specific properties added:
    • prevVal Any
      The value of the attribute, prior to it being set.
    • newVal Any
      The value the attribute is to be set to.
    • attrName String
      The name of the attribute being set.
    • subAttrName String
      If setting a property within the attribute's value, the name of the sub-attribute property being set.

categoryAxis

Axis

Reference to the category axis used by the chart.

Fires event categoryAxisChange

Fires when the value for the configuration attribute categoryAxis is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.

Parameters:

  • e EventFacade
    An Event Facade object with the following attribute-specific properties added:
    • prevVal Any
      The value of the attribute, prior to it being set.
    • newVal Any
      The value the attribute is to be set to.
    • attrName String
      The name of the attribute being set.
    • subAttrName String
      If setting a property within the attribute's value, the name of the sub-attribute property being set.

categoryAxisName

String

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

Fires event categoryAxisNameChange

Fires when the value for the configuration attribute categoryAxisName is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.

Parameters:

  • e EventFacade
    An Event Facade object with the following attribute-specific properties added:
    • prevVal Any
      The value of the attribute, prior to it being set.
    • newVal Any
      The value the attribute is to be set to.
    • attrName String
      The name of the attribute being set.
    • subAttrName String
      If setting a property within the attribute's value, the name of the sub-attribute property being set.

direction

String

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.

Fires event directionChange

Fires when the value for the configuration attribute direction is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.

Parameters:

  • e EventFacade
    An Event Facade object with the following attribute-specific properties added:
    • prevVal Any
      The value of the attribute, prior to it being set.
    • newVal Any
      The value the attribute is to be set to.
    • attrName String
      The name of the attribute being set.
    • subAttrName String
      If setting a property within the attribute's value, the name of the sub-attribute property being set.

graphStyles

Object private

Styles for the graph.

Fires event graphStylesChange

Fires when the value for the configuration attribute graphStyles is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.

Parameters:

  • e EventFacade
    An Event Facade object with the following attribute-specific properties added:
    • prevVal Any
      The value of the attribute, prior to it being set.
    • newVal Any
      The value the attribute is to be set to.
    • attrName String
      The name of the attribute being set.
    • subAttrName String
      If setting a property within the attribute's value, the name of the sub-attribute property being set.

horizontalGridlines

Gridlines

Reference to the horizontalGridlines for the chart.

Fires event horizontalGridlinesChange

Fires when the value for the configuration attribute horizontalGridlines is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.

Parameters:

  • e EventFacade
    An Event Facade object with the following attribute-specific properties added:
    • prevVal Any
      The value of the attribute, prior to it being set.
    • newVal Any
      The value the attribute is to be set to.
    • attrName String
      The name of the attribute being set.
    • subAttrName String
      If setting a property within the attribute's value, the name of the sub-attribute property being set.

leftAxesCollection

Array private

Reference to the left-aligned axes for the chart.

Fires event leftAxesCollectionChange

Fires when the value for the configuration attribute leftAxesCollection is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.

Parameters:

  • e EventFacade
    An Event Facade object with the following attribute-specific properties added:
    • prevVal Any
      The value of the attribute, prior to it being set.
    • newVal Any
      The value the attribute is to be set to.
    • attrName String
      The name of the attribute being set.
    • subAttrName String
      If setting a property within the attribute's value, the name of the sub-attribute property being set.

rightAxesCollection

Array private

Reference to the right-aligned axes for the chart.

Fires event rightAxesCollectionChange

Fires when the value for the configuration attribute rightAxesCollection is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.

Parameters:

  • e EventFacade
    An Event Facade object with the following attribute-specific properties added:
    • prevVal Any
      The value of the attribute, prior to it being set.
    • newVal Any
      The value the attribute is to be set to.
    • attrName String
      The name of the attribute being set.
    • subAttrName String
      If setting a property within the attribute's value, the name of the sub-attribute property being set.

seriesCollection

Array

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.

Fires event seriesCollectionChange

Fires when the value for the configuration attribute seriesCollection is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.

Parameters:

  • e EventFacade
    An Event Facade object with the following attribute-specific properties added:
    • prevVal Any
      The value of the attribute, prior to it being set.
    • newVal Any
      The value the attribute is to be set to.
    • attrName String
      The name of the attribute being set.
    • subAttrName String
      If setting a property within the attribute's value, the name of the sub-attribute property being set.

seriesStyles

Object private

Style object for the series

Fires event seriesStylesChange

Fires when the value for the configuration attribute seriesStyles is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.

Parameters:

  • e EventFacade
    An Event Facade object with the following attribute-specific properties added:
    • prevVal Any
      The value of the attribute, prior to it being set.
    • newVal Any
      The value the attribute is to be set to.
    • attrName String
      The name of the attribute being set.
    • subAttrName String
      If setting a property within the attribute's value, the name of the sub-attribute property being set.

showAreaFill

Boolean

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

Fires event showAreaFillChange

Fires when the value for the configuration attribute showAreaFill is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.

Parameters:

  • e EventFacade
    An Event Facade object with the following attribute-specific properties added:
    • prevVal Any
      The value of the attribute, prior to it being set.
    • newVal Any
      The value the attribute is to be set to.
    • attrName String
      The name of the attribute being set.
    • subAttrName String
      If setting a property within the attribute's value, the name of the sub-attribute property being set.

showLines

Boolean

Indicates whether to display lines in a combo chart.

Fires event showLinesChange

Fires when the value for the configuration attribute showLines is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.

Parameters:

  • e EventFacade
    An Event Facade object with the following attribute-specific properties added:
    • prevVal Any
      The value of the attribute, prior to it being set.
    • newVal Any
      The value the attribute is to be set to.
    • attrName String
      The name of the attribute being set.
    • subAttrName String
      If setting a property within the attribute's value, the name of the sub-attribute property being set.

showMarkers

Boolean

Indicates whether to display markers in a combo chart.

Fires event showMarkersChange

Fires when the value for the configuration attribute showMarkers is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.

Parameters:

  • e EventFacade
    An Event Facade object with the following attribute-specific properties added:
    • prevVal Any
      The value of the attribute, prior to it being set.
    • newVal Any
      The value the attribute is to be set to.
    • attrName String
      The name of the attribute being set.
    • subAttrName String
      If setting a property within the attribute's value, the name of the sub-attribute property being set.

stacked

Boolean

Indicates whether or not the chart is stacked.

Fires event stackedChange

Fires when the value for the configuration attribute stacked is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.

Parameters:

  • e EventFacade
    An Event Facade object with the following attribute-specific properties added:
    • prevVal Any
      The value of the attribute, prior to it being set.
    • newVal Any
      The value the attribute is to be set to.
    • attrName String
      The name of the attribute being set.
    • subAttrName String
      If setting a property within the attribute's value, the name of the sub-attribute property being set.

styles

Object

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:
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.

Fires event stylesChange

Fires when the value for the configuration attribute styles is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.

Parameters:

  • e EventFacade
    An Event Facade object with the following attribute-specific properties added:
    • prevVal Any
      The value of the attribute, prior to it being set.
    • newVal Any
      The value the attribute is to be set to.
    • attrName String
      The name of the attribute being set.
    • subAttrName String
      If setting a property within the attribute's value, the name of the sub-attribute property being set.

topAxesCollection

Array private

Reference to the top-aligned axes for the chart.

Fires event topAxesCollectionChange

Fires when the value for the configuration attribute topAxesCollection is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.

Parameters:

  • e EventFacade
    An Event Facade object with the following attribute-specific properties added:
    • prevVal Any
      The value of the attribute, prior to it being set.
    • newVal Any
      The value the attribute is to be set to.
    • attrName String
      The name of the attribute being set.
    • subAttrName String
      If setting a property within the attribute's value, the name of the sub-attribute property being set.

type

String

Type of chart when there is no series collection specified.

Fires event typeChange

Fires when the value for the configuration attribute type is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.

Parameters:

  • e EventFacade
    An Event Facade object with the following attribute-specific properties added:
    • prevVal Any
      The value of the attribute, prior to it being set.
    • newVal Any
      The value the attribute is to be set to.
    • attrName String
      The name of the attribute being set.
    • subAttrName String
      If setting a property within the attribute's value, the name of the sub-attribute property being set.

valueAxisName

String

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

Fires event valueAxisNameChange

Fires when the value for the configuration attribute valueAxisName is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.

Parameters:

  • e EventFacade
    An Event Facade object with the following attribute-specific properties added:
    • prevVal Any
      The value of the attribute, prior to it being set.
    • newVal Any
      The value the attribute is to be set to.
    • attrName String
      The name of the attribute being set.
    • subAttrName String
      If setting a property within the attribute's value, the name of the sub-attribute property being set.

verticalGridlines

Gridlines

Reference to the verticalGridlines for the chart.

Fires event verticalGridlinesChange

Fires when the value for the configuration attribute verticalGridlines is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.

Parameters:

  • e EventFacade
    An Event Facade object with the following attribute-specific properties added:
    • prevVal Any
      The value of the attribute, prior to it being set.
    • newVal Any
      The value the attribute is to be set to.
    • attrName String
      The name of the attribute being set.
    • subAttrName String
      If setting a property within the attribute's value, the name of the sub-attribute property being set.

Events

planarEvent:mouseout

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

Event Payload:

planarEvent:mouseover

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.