CartesianChart Class
The CartesianChart class creates a chart with horizontal and vertical axes.
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
Attributes
- allowContentOverflow
- axes
- axesStyles
- bottomAxesCollection
- categoryAxis
- categoryAxisName
- direction
- graphStyles
- horizontalGridlines
- leftAxesCollection
- rightAxesCollection
- seriesCollection
- seriesStyles
- showAreaFill
- showLines
- showMarkers
- stacked
- styles
- topAxesCollection
- type
- valueAxisName
- verticalGridlines
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
StringThe position of the axis
-
axis
AxisThe
Axis
instance
_addToAxesRenderQueue
-
axis
Adds an Axis
instance to the _itemRenderQueue
.
Parameters:
-
axis
AxisAn
Axis
instance.
_getAllKeys
-
dp
Returns all the keys contained in a dataProvider
.
Parameters:
-
dp
ArrayCollection of objects to be parsed.
Returns:
_getAriaMessage
-
key
Returns the appropriate message based on the key press.
Parameters:
-
key
NumberThe keycode that was pressed.
Returns:
_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.
Parameters:
-
item
ObjectObject or instance in which the attribute resides.
-
key
StringAttribute whose value will be returned.
Returns:
_getBottomOverflow
-
set1
-
set2
-
height
Returns the maximum distance in pixels that the extends outside the bottom bounds of all vertical axes.
Parameters:
-
set1
ArrayCollection of axes to check.
-
set2
ArraySeconf collection of axes to check.
-
height
NumberHeight of the axes
Returns:
_getCategoryAxis
()
private
Returns the category axis instance for the chart.
Returns:
_getDefaultAxes
()
private
Default Function for the axes attribute.
Returns:
_getDefaultAxisPosition
-
axis
-
valueAxes
-
position
Determines the position of an axis when one is not specified.
Parameters:
-
axis
AxisAxis
instance. -
valueAxes
ArrayArray of
Axis
instances. -
position
StringDefault position depending on the direction of the chart and type of axis.
Returns:
_getDefaultSeriesCollection
-
val
Returns the default value for the seriesCollection
attribute.
Parameters:
-
val
ArrayArray containing either
CartesianSeries
instances or objects containing data to construct series instances.
Returns:
_getLeftOverflow
-
set1
-
set2
-
width
Returns the maximum distance in pixels that the extends outside the left bounds of all horizontal axes.
Parameters:
-
set1
ArrayCollection of axes to check.
-
set2
ArraySeconf collection of axes to check.
-
width
NumberWidth of the axes
Returns:
_getRightOverflow
-
set1
-
set2
-
width
Returns the maximum distance in pixels that the extends outside the right bounds of all horizontal axes.
Parameters:
-
set1
ArrayCollection of axes to check.
-
set2
ArraySeconf collection of axes to check.
-
width
NumberWidth of the axes
Returns:
_getSeriesAxis
-
key
Returns the value axis for a series.
Parameters:
-
key
StringThe key value used to determine the axis instance.
Returns:
_getTopOverflow
-
set1
-
set2
-
width
Returns the maximum distance in pixels that the extends outside the top bounds of all vertical axes.
Parameters:
-
set1
ArrayCollection of axes to check.
-
set2
ArraySeconf collection of axes to check.
-
width
NumberWidth of the axes
Returns:
_parseAxes
-
axes
Generates and returns a key-indexed object containing Axis
instances or objects used to create Axis
instances.
Parameters:
-
axes
ObjectObject containing
Axis
instances orAxis
attributes.
Returns:
_parseSeriesAxes
-
series
Parse and sets the axes for a series instance.
Parameters:
-
series
CartesianSeriesA
CartesianSeries
instance.
_parseSeriesCollection
-
val
Parses and returns a series collection from an object and default properties.
Parameters:
-
val
ObjectObject contain properties for series being set.
Returns:
_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
.
Parameters:
-
e
ObjectEvent object.
_redraw
()
private
Redraws and position all the components of the chart instance.
_setAxes
-
val
Creates Axis
instances.
Parameters:
-
val
ObjectObject containing
Axis
instances or objects in which to constructAxis
instances.
Returns:
_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.
Parameters:
-
item
ObjectObject or instance in which the attribute resides.
-
key
StringAttribute whose value will be assigned.
-
value
ObjectValue to be assigned to the attribute.
_sizeChanged
-
e
Handler for sizeChanged event.
Parameters:
-
e
ObjectEvent object.
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
CartesianSeriesReference to a series.
-
index
NumberIndex of the specified item within a series.
Returns:
- 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.
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.
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.
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.
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.
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.
Events
planarEvent:mouseout
Broadcasts when interactionType
is set to planar
and a series' marker plane has received a mouseout event.
Event Payload:
-
e
EventFacade
planarEvent:mouseover
Broadcasts when interactionType
is set to planar
and a series' marker plane has received a mouseover event.
Event Payload:
-
e
EventFacadeEvent 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.