# Yahoo! UI Library

### charts 3.3.0

Yahoo! UI Library > charts > NumericAxis
Search:
Filters Show Private Show Protected Show Deprecated

## Class NumericAxis - extends AxisType

Known Subclasses:
  StackedAxis

NumericAxis manages numeric data on an axis.

### Constructor

NumericAxis `( config )`

Parameters:
  `config <Object>` (optional) Configuration parameters for the Chart.

### Properties

#### _type - `private object`

#### Properties inherited from AxisType:

`_data, _dataMaximum, _dataReady, _setMaximum, _setMinimum, _type, _updateTotalDataFlag, GUID`

#### Properties inherited from Renderer:

`_styles`

#### Properties inherited from Axis:

`_calculateSizeByTickLength, _labelCache, _labels, _layout`

### Methods

#### _getMinimumUnit

`private void _getMinimumUnit ( )`

#### _getNiceNumber

`private void _getNiceNumber ( )`

#### _roundDownToNearest

`private void _roundDownToNearest ( )`
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().

#### _roundMinAndMax

`private void _roundMinAndMax ( )`

#### _roundToNearest

`private void _roundToNearest ( )`
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().

#### _roundToPrecision

`private void _roundToPrecision ( )`
Rounds a number to a certain level of precision. Useful for limiting the number of decimal places on a fractional number.

#### _roundUpToNearest

`private void _roundUpToNearest ( )`
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().

#### _updateMinAndMax

`private void _updateMinAndMax ( )`

#### getLabelByIndex

`getLabelByIndex ( i , l )`
Calculates and returns a value based on the number of labels and the index of the current label.

Parameters:
  `i <Number>` Index of the label.
  `l <Number>` Total number of labels.

Returns: ``
  String

#### Methods inherited from AxisType:

`_dataProviderChangeHandler, _getKeyArray, _keyChangeHandler, _setDataByKey, _updateMinAndMax, _updateTotalData, addKey, bindUI, getDataByKey, getKeyValueAt, getLabelByIndex, getMajorUnitDistance, getTotalMajorUnits, removeKey`

#### Methods inherited from Renderer:

`_getDefaultStyles, _mergeStyles, _setStyles`

#### Methods inherited from Axis:

`_clearLabelCache, _createLabelCache, _dataChangeHandler, _drawAxis, _getDefaultStyles, _handleSizeChange, _positionChangeHandler, _setCanvas, _updateHandler, drawLine, getFirstPoint, getLabel, getLastPoint, getLayout, getLength, getLineEnd, getNextPoint, getPosition, renderUI, syncUI`

### Events

#### alwaysShowZeroChange

`alwaysShowZeroChange ( event )`
Fires when the value for the configuration attribute 'alwaysShowZero' 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

#### labelFormatChange

`labelFormatChange ( event )`
Fires when the value for the configuration attribute 'labelFormat' 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

#### labelFunctionChange

`labelFunctionChange ( event )`
Fires when the value for the configuration attribute 'labelFunction' 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

#### Events inherited from AxisType:

`dataChange, dataMaximumChange, dataMinimumChange, dataProviderChange, getEdgeOffsetChange, keyCollectionChange, keysChange labelFunctionChange maximumChange minimumChange roundingMethodChange setMaxChange setMinChange typeChange`

#### Events inherited from Renderer:

`graphicChange, stylesChange`

#### Events inherited from Axis:

`bottomTickOffsetChange, edgeOffsetChange, graphicChange, labelFunctionScopeChange, labelsChange, leftTickOffsetChange, nodeChange, overlapGraphChange, positionChange, rightTickOffsetChange stylesChange tickPointsChange topTickOffsetChange`

### Configuration Attributes

#### alwaysShowZero `- Boolean`

Indicates whether 0 should always be displayed.

#### labelFormat `- Object`

Hash of properties used by the `labelFunction` to format a label.

#### labelFunction `- Function`

Formats a label.

#### Configuration attributes inherited from AxisType:

`data, dataMaximum, dataMinimum, dataProvider, getEdgeOffset, keyCollection, keys labelFunction maximum minimum roundingMethod setMax setMin type`

#### Configuration attributes inherited from Renderer:

`graphic styles`

#### Configuration attributes inherited from Axis:

`bottomTickOffset, edgeOffset, graphic, labelFunctionScope, labels, leftTickOffset, node overlapGraph position rightTickOffset styles tickPoints topTickOffset`

Copyright © 2011 Yahoo! Inc. All rights reserved.