Class: YAxis

org.bodytrack.grapher.YAxis(elementId, yMinopt, yMaxopt, willNotPadRangeopt, rangePaddingStrategyFunctionopt)

new YAxis(elementId, yMinopt, yMaxopt, willNotPadRangeopt, rangePaddingStrategyFunctionopt)

Wrapper class to make it easier to work with a Y axis.
Parameters:
Name Type Attributes Default Description
elementId string the DOM element ID for the container div holding this Y axis
yMin number <optional>
0 the minimum initial value for the Y axis. Defaults to 0 if undefined, null, or non-numeric.
yMax number <optional>
100 the maximum initial value for the Y axis. Defaults to 100 if undefined, null, or non-numeric.
willNotPadRange boolean <optional>
false whether to pad the range
rangePaddingStrategyFunction yAxisRangePaddingStrategyFunction <optional>
range padding strategy function (only used if padding is enabled).
Source:

Methods

addAxisChangeListener(listener)

Adds the given function as an axis change listener. Does nothing if the given listener is not a function.
Parameters:
Name Type Description
listener axisChangeListenerFunction function for handling an AxisChangeEvent.
Source:

clearMinRangeConstraints()

Clears the range constraints by setting bounds to [-1 * Number.MAX_VALUE, Number.MAX_VALUE].
Source:

clearRangeConstraints()

Clears the range constraints by setting bounds to [-1 * Number.MAX_VALUE, Number.MAX_VALUE].
Source:

constrainMinRangeTo(rangeOrMin, max, willNotPadopt)

Constrains the range of the axis so that the user cannot pan/zoom deeper than the specified range.
Parameters:
Name Type Attributes Default Description
rangeOrMin AxisRange | number | null an AxisRange a double representing the minimum value. If null, undefined, non-numeric, or not an AxisRange, then -1*Number.MAX_VALUE is used instead.
max number | null the max value. If null, undefined, or non-numeric, then Number.MAX_VALUE is used instead. This argument is ignored (but required) if the first argument is an AxisRange.
willNotPad boolean <optional>
false whether to pad the range
Source:

constrainRangeTo(rangeOrMin, max, willNotPadopt)

Constrains the range of the axis so that the user cannot pan/zoom outside the specified range.
Parameters:
Name Type Attributes Default Description
rangeOrMin AxisRange | number an AxisRange a double representing the minimum value. If null, undefined, non-numeric, or not an AxisRange, then -1*Number.MAX_VALUE is used instead.
max number the max value. If null, undefined, or non-numeric, then Number.MAX_VALUE is used instead. This argument is ignored (but required) if the first argument is an AxisRange.
willNotPad boolean <optional>
false whether to pad the range
Source:

getElementId() → {string}

Returns the DOM element ID for the container div holding this axis.
Source:
Returns:
Type
string

getRange() → {AxisRange}

Returns the Y axis's current range as and object containing mine and max fields.
Source:
Returns:
Type
AxisRange

getWrappedAxis() → {DateAxis}

Returns the wrapped DateAxis object.
Source:
Returns:
Type
DateAxis

removeAxisChangeListener(listener)

Removes the given axis change listener. Does nothing if the given listener is not a function.
Parameters:
Name Type Description
listener axisChangeListenerFunction function for handling an AxisChangeEvent.
Source:

setHeight(height)

Sets the height of the axis.
Parameters:
Name Type Description
height int the new height
Source:

setRange(rangeOrMin, max, willNotPadopt)

Sets the visible range of the axis.
Parameters:
Name Type Attributes Default Description
rangeOrMin AxisRange | number an AxisRange a double representing the minimum value. If null, undefined, non-numeric, or not an AxisRange, then -1*Number.MAX_VALUE is used instead.
max number the max value. If null, undefined, or non-numeric, then Number.MAX_VALUE is used instead. This argument is ignored (but required) if the first argument is an AxisRange.
willNotPad boolean <optional>
false whether to pad the range
Source:

setRangePaddingStrategy(f)

Sets the strategy function for padding the range, if padding is enabled. If f is not a function, then the padding strategy reverts to the default.
Parameters:
Name Type Description
f yAxisRangePaddingStrategyFunction the range padding strategy function
Source: