The CartesianChart class creates a chart with horizontal and vertical axes.
CartesianChart
_addAxes
Adds axes to the chart.
_addGridlines
Adds gridlines to the chart.
_addSeries
Renders the Graph.
_addToAxesCollection
position
axis
Adds axis instance to the appropriate array based on position
_addToAxesRenderQueue
axis
Adds an Axis
instance to the _itemRenderQueue
.
axis
Axis
An Axis
instance.
_addTooltip
Adds a tooltip to the dom.
_buildSeriesKeys
dataProvider
Constructs seriesKeys if not explicitly specified.
dataProvider
Array
The dataProvider for the chart.
Array
_dataProviderChangeHandler
e
Event handler for dataProviderChange.
e
Object
Event object.
_getAllKeys
dp
Returns all the keys contained in a dataProvider
.
dp
Array
Collection of objects to be parsed.
Object
_getAriaMessage
key
Returns the appropriate message based on the key press.
key
Number
The keycode that was pressed.
String
_getAxisClass
t
Helper method that returns the axis class that a key references.
t
String
The type of axis.
Axis
_getBaseAttribute
item
key
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.
Object
_getBottomOverflow
set1
set2
height
Returns the maximum distance in pixels that the extends outside the bottom bounds of all vertical axes.
Number
_getCategoryAxis
Returns the category axis instance for the chart.
Axis
_getDefaultAxes
Default Function for the axes attribute.
Object
_getDefaultAxisPosition
axis
valueAxes
position
Determines the position of an axis when one is not specified.
String
_getDefaultSeriesCollection
val
Returns the default value for the seriesCollection
attribute.
val
Array
Array containing either CartesianSeries
instances or objects containing data to construct series instances.
Array
_getGraph
Default value function for the Graph
attribute.
Graph
_getLeftOverflow
set1
set2
width
Returns the maximum distance in pixels that the extends outside the left bounds of all horizontal axes.
Number
_getRightOverflow
set1
set2
width
Returns the maximum distance in pixels that the extends outside the right bounds of all horizontal axes.
Number
_getSeriesAxis
key
Returns the value axis for a series.
key
String
The key value used to determine the axis instance.
Axis
_getTooltip
Default getter for tooltip
attribute.
Object
_getTopOverflow
set1
set2
width
Returns the maximum distance in pixels that the extends outside the top bounds of all vertical axes.
Number
_groupMarkersChangeHandler
e
Handles groupMarkers change event.
e
Object
Event object.
_markerEventDispatcher
e
Event handler for marker events.
e
Object
Event object.
_parseAxes
axes
Generates and returns a key-indexed object containing Axis
instances or objects used to create Axis
instances.
axes
Object
Object containing Axis
instances or Axis
attributes.
Object
_parseSeriesAxes
series
Parse and sets the axes for a series instance.
series
CartesianSeries
A CartesianSeries
instance.
_parseSeriesCollection
val
Parses and returns a series collection from an object and default properties.
val
Object
Object contain properties for series being set.
Object
_planarEventDispatcher
e
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
.
e
Object
Event object.
_planarLabelFunction
categoryAxis
valueItems
index
seriesArray
seriesIndex
Formats tooltip text when interactionType
is planar
.
categoryAxis
Axis
Reference to the categoryAxis of the chart.
valueItems
Array
Array of objects for each series that has a data point in the coordinate plane of the event. Each object contains the following data:
index
Number
The index of the item within its series.
seriesArray
Array
Array of series instances for each value item.
seriesIndex
Number
The index of the series in the seriesCollection
.
_redraw
Redraws and position all the components of the chart instance.
_setAriaElements
cb
Creates an aria live-region
, aria-label
and aria-describedby
for the Chart.
cb
Node
Reference to the Chart's contentBox
attribute.
_setAxes
val
Creates Axis
instances.
val
Object
Object containing Axis
instances or objects in which to construct Axis
instances.
Object
_setBaseAttribute
item
key
value
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.
_setDataValues
val
Setter method for dataProvider
attribute.
val
Array
Array to be set as dataProvider
.
Array
_setOffscreen
Sets a node offscreen for use as aria-description or aria-live-regin.
Node
_setText
label
val
Updates the content of text field. This method writes a value into a text field using
appendChild
. If the value is a String
, it is converted to a TextNode
first.
label
HTMLElement
label to be updated
val
String
value with which to update the label
_showTooltip
msg
x
y
Shows a tooltip
_tooltipChangeHandler
e
Event handler for the tooltipChange.
e
Object
Event object.
_tooltipLabelFunction
categoryItem
valueItem
Formats tooltip text when interactionType
is marker
.
categoryItem
Object
An object containing the following:
valueItem
Object
An object containing the following:
_updateTooltip
val
Updates the tooltip attribute.
val
Object
Object containing properties for the tooltip.
Object
_wereSeriesKeysExplicitlySet
Utility method to determine if seriesKeys
was explicitly provided
(for example during construction, or set by the user), as opposed to
being derived from the dataProvider for example.
boolean true if the seriesKeys
attribute was explicitly set.
bindUI
destructor
Destructor implementation for the CartesianChart class. Calls destroy on all axes, series and the Graph instance. Removes the tooltip and overlay HTML elements.
getAxisByKey
val
Returns an Axis
instance by key reference. If the axis was explicitly set through the axes
attribute,
the key will be the same as the key used in the axes
object. For default axes, the key for
the category axis is the value of the categoryKey
(category
). For the value axis, the default
key is values
.
val
String
Key reference used to look up the axis.
Axis
getCategoryAxis
Returns the category axis for the chart.
Axis
getSeries
val
Returns a series instance by index or key value.
val
Object
CartesianSeries
getSeriesItems
series
index
Returns an object literal containing a categoryItem and a valueItem for a given series index. Below is the structure of each:
series
CartesianSeries
Reference to a series.
index
Number
Index of the specified item within a series.
Object An object literal containing the following:
hideTooltip
Hides the default tooltip
initializer
renderUI
syncUI
toggleTooltip
e
Event listener for toggling the tooltip. If a tooltip is visible, hide it. If not, it will create and show a tooltip based on the event object.
e
Object
Event object.
_itemRenderQueue
Queue of axes instances that will be updated. This method is used internally to determine when all axes have been updated.
_setSeriesCollection
Setter method for seriesCollection
attribute.
val
Array
Array of either CartesianSeries
instances or objects containing series attribute key value pairs.
allowContentOverflow
Indicates whether axis labels are allowed to overflow beyond the bounds of the chart's content box.
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.
e
EventFacade
ariaDescription
Sets the aria description for the chart.
ariaDescriptionChange
Fires when the value for the configuration attribute ariaDescription
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.
e
EventFacade
ariaLabel
Sets the aria-label
for the chart.
ariaLabelChange
Fires when the value for the configuration attribute ariaLabel
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.
e
EventFacade
axes
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.
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.
e
EventFacade
axesCollection
Reference to all the axes in the chart.
axesCollectionChange
Fires when the value for the configuration attribute axesCollection
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.
e
EventFacade
axesStyles
Style object for the axes.
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.
e
EventFacade
bottomAxesCollection
Reference to the bottom-aligned axes for the chart.
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.
e
EventFacade
categoryAxis
Reference to the category axis used by the chart.
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.
e
EventFacade
categoryAxisName
Indicates the key value used to identify a category axis in the axes
hash. If
not specified, the categoryKey attribute value will be used.
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.
e
EventFacade
categoryKey
The key value used for the chart's category axis.
Default: category
categoryKeyChange
Fires when the value for the configuration attribute categoryKey
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.
e
EventFacade
categoryType
Indicates the type of axis to use for the category axis.
CategoryAxis
.Default: category
categoryTypeChange
Fires when the value for the configuration attribute categoryType
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.
e
EventFacade
dataProvider
Data used to generate the chart.
dataProviderChange
Fires when the value for the configuration attribute dataProvider
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.
e
EventFacade
direction
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.
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.
e
EventFacade
graph
Reference to graph instance.
graphChange
Fires when the value for the configuration attribute graph
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.
e
EventFacade
graphStyles
Styles for the graph.
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.
e
EventFacade
groupMarkers
Indicates whether or not markers for a series will be grouped and rendered in a single complex shape instance.
groupMarkersChange
Fires when the value for the configuration attribute groupMarkers
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.
e
EventFacade
horizontalGridlines
Reference to the horizontalGridlines for the chart.
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.
e
EventFacade
interactionType
Indicates the the type of interactions that will fire events.
Default: marker
interactionTypeChange
Fires when the value for the configuration attribute interactionType
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.
e
EventFacade
leftAxesCollection
Reference to the left-aligned axes for the chart.
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.
e
EventFacade
rightAxesCollection
Reference to the right-aligned axes for the chart.
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.
e
EventFacade
seriesCollection
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.
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.
e
EventFacade
seriesKeys
A collection of keys that map to the series axes. If no keys are set, they will be generated automatically depending on the data structure passed into the chart.
seriesKeysChange
Fires when the value for the configuration attribute seriesKeys
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.
e
EventFacade
seriesStyles
Style object for the series
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.
e
EventFacade
showAreaFill
Indicates whether or not an area is filled in a combo chart.
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.
e
EventFacade
showLines
Indicates whether to display lines in a combo chart.
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.
e
EventFacade
showMarkers
Indicates whether to display markers in a combo chart.
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.
e
EventFacade
stacked
Indicates whether or not the chart is stacked.
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.
e
EventFacade
styles
Style properties for the chart. Contains a key indexed hash of the following:
styles
attribute for each series in the chart.
Specific style attributes vary depending on the series:
styles
attribute for each axes in the chart. Specific
style attributes can be found in the Axis class.styles
attribute in the chart. Specific style attributes can be found in the
Graph class.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.
e
EventFacade
tooltip
Reference to the default tooltip available for the chart.
Contains the following properties:
CartesianSeries
instance of the item.seriesCollection
.HTMLElement
which is written into the DOM using appendChild
. If you override this method and choose
to return an html string, you will also need to override the tooltip's setTextFunction
method to accept an html string.
CategoryAxis
Reference to the categoryAxis of the chart.
seriesCollection
.HTMLElement
which is written into the DOM using appendChild
. If you override this method and choose
to return an html string, you will also need to override the tooltip's setTextFunction
method to accept an html string.
planarLabelFunction
or markerLabelFunction
into the
the tooltip node. Has the following signature:
HTMLElement
that the content is to be added.String
or HTMLElement
. If an HTML string is used,
it will be rendered as a string.tooltipChange
Fires when the value for the configuration attribute tooltip
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.
e
EventFacade
topAxesCollection
Reference to the top-aligned axes for the chart.
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.
e
EventFacade
type
Type of chart when there is no series collection specified.
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.
e
EventFacade
valueAxisName
Indicates the key value used to identify a the series axis when an axis not generated.
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.
e
EventFacade
verticalGridlines
Reference to the verticalGridlines for the chart.
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.
e
EventFacade
markerEvent:click
Broadcasts when interactionType
is set to marker
and a series marker has received a click event.
e
EventFacade
Event facade with the following additional properties:
Axis
.Axis
.order
of the marker's series.markerEvent:mousedown
Broadcasts when interactionType
is set to marker
and a series marker has received a mousedown event.
e
EventFacade
Event facade with the following additional properties:
Axis
.Axis
.order
of the marker's series.markerEvent:mouseout
Broadcasts when interactionType
is set to marker
and a series marker has received a mouseout event.
e
EventFacade
Event facade with the following additional properties:
Axis
.Axis
.order
of the marker's series.markerEvent:mouseover
Broadcasts when interactionType
is set to marker
and a series marker has received a mouseover event.
e
EventFacade
Event facade with the following additional properties:
Axis
.Axis
.order
of the marker's series.markerEvent:mouseup
Broadcasts when interactionType
is set to marker
and a series marker has received a mouseup event.
e
EventFacade
Event facade with the following additional properties:
Axis
.Axis
.order
of the marker's series.planarEvent:mouseout
Broadcasts when interactionType
is set to planar
and a series' marker plane has received a mouseout event.
planarEvent:mouseover
Broadcasts when interactionType
is set to planar
and a series' marker plane has received a mouseover event.
e
EventFacade
Event facade with the following additional properties:
Axis
of each marker
whose plane has been intersected.Axis
of each marker whose
plane has been intersected.