Class Axis
- extends Renderer
- Known Subclasses:
-
AxisType
The Axis class. Generates axes for a chart.
Methods
private
void
_clearLabelCache
(
)
private
void
_createLabelCache
(
)
private
void
_dataChangeHandler
(
)
private
void
_drawAxis
(
)
protected
_getDefaultStyles
(
)
Gets the default value for the styles
attribute. Overrides
base implementation.
private
void
_handleSizeChange
(
)
private
void
_positionChangeHandler
(
)
private
void
_setCanvas
(
)
private
void
_updateHandler
(
)
private
void
drawLine
(
)
private
void
getFirstPoint
(
)
private
void
getLabel
(
)
private
void
getLastPoint
(
)
private
void
getLayout
(
)
private
void
getLength
(
)
private
void
getLineEnd
(
)
private
void
getNextPoint
(
)
private
void
getPosition
(
)
private
void
renderUI
(
)
Events
bottomTickOffsetChange
(
event
)
Fires when the value for the configuration attribute 'bottomTickOffset' 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
edgeOffsetChange
(
event
)
Fires when the value for the configuration attribute 'edgeOffset' 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
graphicChange
(
event
)
Fires when the value for the configuration attribute 'graphic' 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
labelFunctionScopeChange
(
event
)
Fires when the value for the configuration attribute 'labelFunctionScope' 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
labelsChange
(
event
)
Fires when the value for the configuration attribute 'labels' 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
leftTickOffsetChange
(
event
)
Fires when the value for the configuration attribute 'leftTickOffset' 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
nodeChange
(
event
)
Fires when the value for the configuration attribute 'node' 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
overlapGraphChange
(
event
)
Fires when the value for the configuration attribute 'overlapGraph' 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
positionChange
(
event
)
Fires when the value for the configuration attribute 'position' 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
rightTickOffsetChange
(
event
)
Fires when the value for the configuration attribute 'rightTickOffset' 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
stylesChange
(
event
)
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:
-
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
tickPointsChange
(
event
)
Fires when the value for the configuration attribute 'tickPoints' 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
topTickOffsetChange
(
event
)
Fires when the value for the configuration attribute 'topTickOffset' 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
Distance determined by the tick styles used to calculate the distance between the axis
line in relation to the bottom of the axis.
Difference betweend the first/last tick and edge of axis.
The graphic in which the axis line and ticks will be rendered.
Object which should have by the labelFunction
Collection of labels used to render the axis.
Distance determined by the tick styles used to calculate the distance between the axis
line in relation to the left of the axis.
node
- HTMLElement
Contains the contents of the axis.
Indicates whether the axis overlaps the graph. If an axis is the inner most axis on a given
position and the tick position is inside or cross, the axis will need to overlap the graph.
Distance determined by the tick styles used to calculate the distance between the axis
line in relation to the right side of the axis.
Style properties used for drawing an axis. This attribute is inherited from
Renderer
. Below are the default values:
- majorTicks
- Properties used for drawing ticks.
- display
- Position of the tick. Possible values are
inside
, outside
, cross
and none
. The
default value is inside
.
- length
- The length (in pixels) of the tick. The default value is 4.
- color
- The color of the tick. The default value is
#dad8c9
- weight
- Number indicating the width of the tick. The default value is 1.
- alpha
- Number from 0 to 1 indicating the opacity of the tick. The default value is 1.
- line
- Properties used for drawing the axis line.
- weight
- Number indicating the width of the axis line. The default value is 1.
- color
- The color of the axis line. The default value is
#dad8c9
.
- alpha
- Number from 0 to 1 indicating the opacity of the tick. The default value is 1.
- majorUnit
- Properties used to calculate the
majorUnit
for the axis.
- determinant
- The algorithm used for calculating distance between ticks. The possible options are
count
and distance
. If
the determinant
is count
, the axis ticks will spaced so that a specified number of ticks appear on the axis. If the determinant
is distance
, the axis ticks will spaced out according to the specified distance. The default value is count
.
- count
- Number of ticks to appear on the axis when the
determinant
is count
. The default value is 11.
- distance
- The distance (in pixels) between ticks when the
determinant
is distance
. The default value is 75.
- label
- Properties and styles applied to the axis labels.
- color
- The color of the labels. The default value is
#808080
.
- alpha
- Number between 0 and 1 indicating the opacity of the labels. The default value is 1.
- fontSize
- The font-size of the labels. The default value is 85%
- rotation
- The rotation, in degrees (between -90 and 90) of the labels. The default value is 0.
- margin
- The distance between the label and the axis/tick. Depending on the position of the
Axis
, only one of the properties used.
- top
- Pixel value used for an axis with a
position
of bottom
. The default value is 4.
- right
- Pixel value used for an axis with a
position
of left
. The default value is 4.
- bottom
- Pixel value used for an axis with a
position
of top
. The default value is 4.
- left
- Pixel value used for an axis with a
position
of right
. The default value is 4.
Collection of points used for placement of labels and ticks along the axis.
Distance determined by the tick styles used to calculate the distance between the axis
line in relation to the top of the axis.
Configuration attributes inherited from Renderer: