# Yahoo! UI Library

### charts 3.3.0

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

## Class CategoryAxis - extends AxisType

CategoryAxis manages category data on an axis.

### Constructor

CategoryAxis `( config )`

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

### Properties

#### _indices - `private object`

#### _type - `private object`

#### GUID - `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

#### _getKeyArray

`private void _getKeyArray ( )`

#### _setDataByKey

`private void _setDataByKey ( )`

#### _updateMinAndMax

`private void _updateMinAndMax ( )`

#### getDataByKey

`getDataByKey ( value )`
Returns an array of values based on an identifier key.

Parameters:
  `value <String>` value used to identify the array

Returns: ``
  Array

#### getEdgeOffset

`getEdgeOffset ( ct , l )`
Gets the distance that the first and last ticks are offset from there respective edges.

Parameters:
  `ct <Number>` Number of ticks on the axis.
  `l <Number>` Length (in pixels) of the axis.

Returns: ``
  Number

#### 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

#### getMajorUnitDistance

`getMajorUnitDistance ( len , uiLen , majorUnit )`
Returns the distance between major units on an axis.

Parameters:
  `len <Number>` Number of ticks
  `uiLen <Number>` Size of the axis.
  `majorUnit <Object>` Hash of properties used to determine the majorUnit

Returns: ``
  Number

#### getTotalMajorUnits

`getTotalMajorUnits ( )`
Returns the total number of majorUnits that will appear on an axis.

Returns: ``
  Number

#### 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 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 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.