NumericAxis Class
NumericAxis manages numeric data on an axis.
Item Index
Methods
Properties
Attributes
Methods
_getMinimumUnit
-
max
-
min
-
units
Helper method for getting a roundingUnit
when calculating the minimum and maximum values.
Parameters:
-
max
NumberMaximum number
-
min
NumberMinimum number
-
units
NumberNumber of units on the axis
Returns:
_getNiceNumber
-
roundingUnit
Calculates a nice rounding unit based on the range.
Parameters:
-
roundingUnit
NumberThe calculated rounding unit.
Returns:
_hasDataOverflow
()
protected
Checks to see if data extends beyond the range of the axis. If so, that data will need to be hidden. This method is internal, temporary and subject to removal in the future.
Returns:
_roundDownToNearest
-
number
-
nearest
Rounds a Number down to the nearest multiple of an input. For example, by rounding 16 down to the nearest 10, you will receive 10. Similar to the built-in function Math.floor().
Parameters:
-
number
NumberNumber to round
-
nearest
NumberMultiple to round towards.
Returns:
_roundMinAndMax
-
min
-
max
Rounds the mimimum and maximum values based on the roundingUnit
attribute.
Parameters:
-
min
NumberMinimum value
-
max
NumberMaximum value
_roundToNearest
-
number
-
nearest
Rounds a Number to the nearest multiple of an input. For example, by rounding 16 to the nearest 10, you will receive 20. Similar to the built-in function Math.round().
Parameters:
-
number
NumberNumber to round
-
nearest
NumberMultiple to round towards.
Returns:
_roundToPrecision
-
number
-
precision
Rounds a number to a certain level of precision. Useful for limiting the number of decimal places on a fractional number.
Parameters:
-
number
NumberNumber to round
-
precision
NumberMultiple to round towards.
Returns:
_roundUpToNearest
-
number
-
nearest
Rounds a Number up to the nearest multiple of an input. For example, by rounding 16 up to the nearest 10, you will receive 20. Similar to the built-in function Math.ceil().
Parameters:
-
number
NumberNumber to round
-
nearest
NumberMultiple to round towards.
Returns:
_updateMinAndMax
()
private
Calculates the maximum and minimum values for the Axis
.
formatLabel
-
value
-
format
Formats a label based on the axis type and optionally specified format.
Parameters:
-
value
Object -
format
ObjectPattern used to format the value.
Returns:
getLabelByIndex
-
i
-
l
Calculates and returns a value based on the number of labels and the index of the current label.
Parameters:
-
i
NumberIndex of the label.
-
l
NumberTotal number of labels.
Returns:
getTotalByKey
-
key
Returns the sum of all values per key.
Parameters:
-
key
StringThe identifier for the array whose values will be calculated.
Returns:
Properties
_type
Unknown
private
Type of data used in Axis
.
Attributes
labelFunction
Function
Method used for formatting a label. This attribute allows for the default label formatting method to overridden. The method use would need
to implement the arguments below and return a String
or an HTMLElement
. The default implementation of the method returns a String
. The output of this method
will be rendered to the DOM using appendChild
. If you override the labelFunction
method and return an html string, you will also need to override the Axis'
appendLabelFunction
to accept html as a String
.
- val
- Label to be formatted. (
String
) - format
- Object containing properties used to format the label. (optional)