Class ChartBase
- Known Subclasses:
-
CartesianChart
PieChart
The ChartBase class is an abstract class used to create charts.
Methods
private
void
_addTooltip
(
)
private
void
_dataProviderChangeHandler
(
)
private
void
_getAxisClass
(
)
private
void
_getGraph
(
)
Default value function for the graph
attribute.
private
void
_getTooltip
(
)
private
void
_markerEventDispatcher
(
)
private
void
_planarLabelFunction
(
)
private
void
_positionTooltip
(
)
private
void
_setDataValues
(
)
private
void
_setSeriesCollection
(
)
private
void
_showTooltip
(
)
private
void
_tooltipChangeHandler
(
)
private
void
_tooltipLabelFunction
(
)
private
void
_updateTooltip
(
)
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
.
- Parameters:
-
val
<String>
Key reference used to look up the axis.
- Returns:
- Axis
getCategoryAxis
(
)
Returns the category axis for the chart.
getSeries
(
val
)
Returns a series instance by index or key value.
- Parameters:
-
val
<object>
- Returns:
- CartesianSeries
void
hideTooltip
(
)
Hides the default tooltip
private
void
renderUI
(
)
void
toggleTooltip
(
)
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.
Events
axesCollectionChange
(
event
)
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.
- Parameters:
-
event
<Event.Facade>
An Event Facade object with the following attribute specific properties added: - prevVal
- The value of the attribute, prior to it being set
- newVal
- The value the attribute is to be set to
- attrName
- The name of the attribute being set
- subAttrName
- If setting a property within the attribute's value, the name of the sub-attribute property being set
categoryKeyChange
(
event
)
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.
- Parameters:
-
event
<Event.Facade>
An Event Facade object with the following attribute specific properties added: - prevVal
- The value of the attribute, prior to it being set
- newVal
- The value the attribute is to be set to
- attrName
- The name of the attribute being set
- subAttrName
- If setting a property within the attribute's value, the name of the sub-attribute property being set
categoryTypeChange
(
event
)
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.
- Parameters:
-
event
<Event.Facade>
An Event Facade object with the following attribute specific properties added: - prevVal
- The value of the attribute, prior to it being set
- newVal
- The value the attribute is to be set to
- attrName
- The name of the attribute being set
- subAttrName
- If setting a property within the attribute's value, the name of the sub-attribute property being set
dataProviderChange
(
event
)
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.
- Parameters:
-
event
<Event.Facade>
An Event Facade object with the following attribute specific properties added: - prevVal
- The value of the attribute, prior to it being set
- newVal
- The value the attribute is to be set to
- attrName
- The name of the attribute being set
- subAttrName
- If setting a property within the attribute's value, the name of the sub-attribute property being set
graphChange
(
event
)
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.
- Parameters:
-
event
<Event.Facade>
An Event Facade object with the following attribute specific properties added: - prevVal
- The value of the attribute, prior to it being set
- newVal
- The value the attribute is to be set to
- attrName
- The name of the attribute being set
- subAttrName
- If setting a property within the attribute's value, the name of the sub-attribute property being set
interactionTypeChange
(
event
)
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.
- Parameters:
-
event
<Event.Facade>
An Event Facade object with the following attribute specific properties added: - prevVal
- The value of the attribute, prior to it being set
- newVal
- The value the attribute is to be set to
- attrName
- The name of the attribute being set
- subAttrName
- If setting a property within the attribute's value, the name of the sub-attribute property being set
markerEvent:click
(
e
)
Broadcasts when interactionType
is set to marker
and a series marker has received a click event.
- Parameters:
-
e
<EventFacade>
Event facade with the following additional
properties:
- categoryItem
- Hash containing information about the category
Axis
.
- valueItem
- Hash containing information about the value
Axis
.
- node
- The dom node of the marker.
- x
- The x-coordinate of the mouse in relation to the Chart.
- y
- The y-coordinate of the mouse in relation to the Chart.
- series
- Reference to the series of the marker.
- index
- Index of the marker in the series.
- seriesIndex
- The
order
of the marker's series.
Preventable: This event is preventable by method e.preventDefault(). The default function executed by this event is false.
markerEvent:mousedown
(
e
)
Broadcasts when interactionType
is set to marker
and a series marker has received a mousedown event.
- Parameters:
-
e
<EventFacade>
Event facade with the following additional
properties:
- categoryItem
- Hash containing information about the category
Axis
.
- valueItem
- Hash containing information about the value
Axis
.
- node
- The dom node of the marker.
- x
- The x-coordinate of the mouse in relation to the Chart.
- y
- The y-coordinate of the mouse in relation to the Chart.
- series
- Reference to the series of the marker.
- index
- Index of the marker in the series.
- seriesIndex
- The
order
of the marker's series.
Preventable: This event is preventable by method e.preventDefault(). The default function executed by this event is false.
markerEvent:mouseout
(
e
)
Broadcasts when interactionType
is set to marker
and a series marker has received a mouseout event.
- Parameters:
-
e
<EventFacade>
Event facade with the following additional
properties:
- categoryItem
- Hash containing information about the category
Axis
.
- valueItem
- Hash containing information about the value
Axis
.
- node
- The dom node of the marker.
- x
- The x-coordinate of the mouse in relation to the Chart.
- y
- The y-coordinate of the mouse in relation to the Chart.
- series
- Reference to the series of the marker.
- index
- Index of the marker in the series.
- seriesIndex
- The
order
of the marker's series.
Preventable: This event is preventable by method e.preventDefault(). The default function executed by this event is false.
markerEvent:mouseover
(
e
)
Broadcasts when interactionType
is set to marker
and a series marker has received a mouseover event.
- Parameters:
-
e
<EventFacade>
Event facade with the following additional
properties:
- categoryItem
- Hash containing information about the category
Axis
.
- valueItem
- Hash containing information about the value
Axis
.
- node
- The dom node of the marker.
- x
- The x-coordinate of the mouse in relation to the Chart.
- y
- The y-coordinate of the mouse in relation to the Chart.
- series
- Reference to the series of the marker.
- index
- Index of the marker in the series.
- seriesIndex
- The
order
of the marker's series.
Preventable: This event is preventable by method e.preventDefault(). The default function executed by this event is false.
markerEvent:mouseup
(
e
)
Broadcasts when interactionType
is set to marker
and a series marker has received a mouseup event.
- Parameters:
-
e
<EventFacade>
Event facade with the following additional
properties:
- categoryItem
- Hash containing information about the category
Axis
.
- valueItem
- Hash containing information about the value
Axis
.
- node
- The dom node of the marker.
- x
- The x-coordinate of the mouse in relation to the Chart.
- y
- The y-coordinate of the mouse in relation to the Chart.
- series
- Reference to the series of the marker.
- index
- Index of the marker in the series.
- seriesIndex
- The
order
of the marker's series.
Preventable: This event is preventable by method e.preventDefault(). The default function executed by this event is false.
seriesKeysChange
(
event
)
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.
- Parameters:
-
event
<Event.Facade>
An Event Facade object with the following attribute specific properties added: - prevVal
- The value of the attribute, prior to it being set
- newVal
- The value the attribute is to be set to
- attrName
- The name of the attribute being set
- subAttrName
- If setting a property within the attribute's value, the name of the sub-attribute property being set
tooltipChange
(
event
)
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.
- Parameters:
-
event
<Event.Facade>
An Event Facade object with the following attribute specific properties added: - prevVal
- The value of the attribute, prior to it being set
- newVal
- The value the attribute is to be set to
- attrName
- The name of the attribute being set
- subAttrName
- If setting a property within the attribute's value, the name of the sub-attribute property being set
Configuration Attributes
Reference to all the axes in the chart.
The key value used for the chart's category axis.
Default Value: category
Indicates the type of axis to use for the category axis.
- category
- Specifies a
CategoryAxis
.
- time
- Specifies a
TimeAxis
Default Value: category
Data used to generate the chart.
Reference to graph instance.
Indicates the the type of interactions that will fire events.
- marker
- Events will be broadcasted when the mouse interacts with individual markers.
- planar
- Events will be broadcasted when the mouse intersects the plane of any markers on the chart.
- none
- No events will be broadcasted.
Default Value: marker
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.
Reference to the default tooltip available for the chart.
Contains the following properties:
- node
- Reference to the actual dom node
- showEvent
- Event that should trigger the tooltip
- hideEvent
- Event that should trigger the removal of a tooltip (can be an event or an array of events)
- styles
- A hash of style properties that will be applied to the tooltip node
- show
- Indicates whether or not to show the tooltip
- markerEventHandler
- Displays and hides tooltip based on marker events
- planarEventHandler
- Displays and hides tooltip based on planar events
- markerLabelFunction
- Reference to the function used to format a marker event triggered tooltip's text
- planarLabelFunction
- Reference to the function used to format a planar event triggered tooltip's text