#

API Docs for:
Show: Inherited Protected Private Deprecated

# CategoryAxis Class

Defined in: `input/charts/CategoryAxis.js:1`
Module: charts

CategoryAxis manages category data on an axis.

- Index
- Methods
- Properties

## Item Index

### Methods

- _getKeyArray
- _setDataByKey
- _updateMinAndMax
- formatLabel
- getDataByKey
- getEdgeOffset
- getKeyValueAt
- getLabelByIndex
- getMajorUnitDistance
- getMaximumValue
- getMinimumValue
- getTotalMajorUnits

### Properties

- _dataType
- _indices
- GUID

## Methods

### `_getKeyArray`

(

- `key`
- `data`

)
private

Defined in `input/charts/CategoryAxis.js:70`

Gets an array of values based on a key.

#### Parameters:

- `key` String

  Value key associated with the data array.

- `data` Array

  Array in which the data resides.

#### Returns:

Array

### `_setDataByKey`

(

- `key`
- `data`

)
private

Defined in `input/charts/CategoryAxis.js:100`

Sets data by key

#### Parameters:

- `key` String

  Key value to use.

- `data` Array

  Array to use.

### `_updateMinAndMax`

() private

Defined in `input/charts/CategoryAxis.js:58`

Calculates the maximum and minimum values for the `Axis`.

### `formatLabel`

(

- `value`
- `format`

)

Defined in `input/charts/CategoryAxis.js:19`

Formats a label based on the axis type and optionally specified format.

#### Parameters:

- `value` Object
- `format` Object

  Pattern used to format the value.

#### Returns:

String

### `getDataByKey`

(

- `value`

)

Defined in `input/charts/CategoryAxis.js:131`

Returns an array of values based on an identifier key.

#### Parameters:

- `value` String

  value used to identify the array

#### Returns:

Array

### `getEdgeOffset`

(

- `ct`
- `l`

)

Defined in `input/charts/CategoryAxis.js:188`

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

### `getKeyValueAt`

(

- `key`
- `index`

)

Defined in `input/charts/CategoryAxis.js:202`

Returns a value based of a key value and an index.

#### Parameters:

- `key` String

  value used to look up the correct array

- `index` Number

  within the array

#### Returns:

String

### `getLabelByIndex`

(

- `i`
- `l`

)

Defined in `input/charts/CategoryAxis.js:221`

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`

(

- `len`
- `uiLen`
- `majorUnit`

)

Defined in `input/charts/CategoryAxis.js:165`

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

### `getMaximumValue`

()

Defined in `input/charts/CategoryAxis.js:260`

Returns a string corresponding to the last label on an axis.

#### Returns:

String

### `getMinimumValue`

()

Defined in `input/charts/CategoryAxis.js:246`

Returns a string corresponding to the first label on an axis.

#### Returns:

String

### `getTotalMajorUnits`

(

- `majorUnit`
- `len`

)

Defined in `input/charts/CategoryAxis.js:152`

Returns the total number of majorUnits that will appear on an axis.

#### Parameters:

- `majorUnit` Object

  Object containing properties related to the majorUnit.

- `len` Number

  Length of the axis.

#### Returns:

Number

## Properties

### `_dataType`

Unknown private

Defined in `input/charts/CategoryAxis.js:49`

Type of data used in `Axis`.

### `_indices`

Unknown private

Defined in `input/charts/CategoryAxis.js:32`

Object storing key data.

### `GUID`

String private

Defined in `input/charts/CategoryAxis.js:40`

Constant used to generate unique id.