Chart axis.
- Source:
- Copyright:
- 2016 Frédéric Massart - FMCorz.net
- License:
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
Classes
Methods
(static) create(obj) → {module:core/chart_axis}
- Source:
Create a new instance of an axis from serialised data.
Parameters:
Name | Type | Description |
---|---|---|
obj |
Object | The data of the axis. |
Returns:
(inner) getLabel() → {String}
- Source:
Get the label of the axis.
Returns:
- Type
- String
(inner) getLabels() → {Array.<String>}
- Source:
Get the labels of the ticks of the axis.
Returns:
- Type
- Array.<String>
(inner) getMax() → {Number}
- Source:
Get the maximum value of the axis.
Returns:
- Type
- Number
(inner) getMin() → {Number}
- Source:
Get the minimum value of the axis.
Returns:
- Type
- Number
(inner) getPosition() → {String}
- Source:
Get the position of the axis.
Returns:
- Type
- String
(inner) getStepSize() → {Number}
- Source:
Get the step size of the axis.
Returns:
- Type
- Number
(inner) setLabel(label)
- Source:
Set the label of the axis.
Parameters:
Name | Type | Description |
---|---|---|
label |
String | The label. |
(inner) setLabels(labels)
- Source:
Set the labels of the values on the axis.
This automatically sets the _stepSize, _min and _max to define a scale from 0 to the number of labels when none of the previously mentioned values have been modified.
You can use other values so long that your values in a series are mapped to the values represented by your _min, _max and _stepSize.
Parameters:
Name | Type | Description |
---|---|---|
labels |
Array.<String> | The labels. |
(inner) setMax(max)
- Source:
Set the maximum value on the axis.
When this is not set (or set to null) it is left for the output library to best guess what should be used.
Parameters:
Name | Type | Description |
---|---|---|
max |
Number | The value. |
(inner) setMin(min)
- Source:
Set the minimum value on the axis.
When this is not set (or set to null) it is left for the output library to best guess what should be used.
Parameters:
Name | Type | Description |
---|---|---|
min |
Number | The value. |
(inner) setPosition(position)
- Source:
Set the position of the axis.
This does not validate whether or not the constant used is valid as the axis itself is not aware whether it represents the X or Y axis.
The output library has to have a fallback in case the values are incorrect. When this is not set to module:core/chart_axis#POS_DEFAULT it is up to the output library to choose what position fits best.
Parameters:
Name | Type | Description |
---|---|---|
position |
String | The value. |
(inner) setStepSize(stepSize)
- Source:
Set the stepSize on the axis.
This is used to determine where ticks are displayed on the axis between min and max.
Parameters:
Name | Type | Description |
---|---|---|
stepSize |
Number | The value. |