#

API Docs for:
Show: Inherited Protected Private Deprecated

# AxisType Class

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

AxisType is an abstract class that manages the data for an axis.

- Index
- Methods
- Properties
- Attributes

## Item Index

### Methods

- _dataProviderChangeHandler
- _getKeyArray
- _hasDataOverflow
- _keyChangeHandler
- _setDataByKey
- _updateMinAndMax
- _updateTotalData
- addKey
- bindUI
- getDataByKey
- getEdgeOffset
- getKeyValueAt
- getLabelByIndex
- getMajorUnitDistance
- getMaximumValue
- getMinimumValue
- getTotalMajorUnits
- initializer
- removeKey

### Properties

- _data
- _dataMaximum
- _dataReady
- _setMaximum
- _setMinimum
- _type
- _updateTotalDataFlag
- GUID

### Attributes

- data
- dataMaximum
- dataMinimum
- dataProvider
- keyCollection
- keys
- maximum
- minimum
- roundingMethod
- setMax
- setMin
- type

## Methods

### `_dataProviderChangeHandler`

(

- `e`

)
private

Defined in `input/charts/AxisType.js:41`

Handles changes to `dataProvider`.

#### Parameters:

- `e` Object

  Event object.

### `_getKeyArray`

(

- `key`
- `data`

)
private

Defined in `input/charts/AxisType.js:155`

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

### `_hasDataOverflow`

() protected

Defined in `input/charts/AxisType.js:404`

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:

Boolean

### `_keyChangeHandler`

(

- `e`

)
private

Defined in `input/charts/AxisType.js:391`

Updates the `Axis` after a change in keys.

#### Parameters:

- `e` Object

  Event object.

### `_setDataByKey`

(

- `key`
- `data`

)
private

Defined in `input/charts/AxisType.js:178`

Sets data by key

#### Parameters:

- `key` String

  Key value to use.

- `data` Array

  Array to use.

### `_updateMinAndMax`

() private

Defined in `input/charts/AxisType.js:276`

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

### `_updateTotalData`

() private

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

Updates the total data array.

### `addKey`

(

- `value`

)

Defined in `input/charts/AxisType.js:143`

Adds an array to the key hash.

#### Parameters:

- `value` Object

  Indicates what key to use in retrieving the array.

### `bindUI`

() private

Defined in `input/charts/AxisType.js:26`

### `getDataByKey`

(

- `value`

)

Defined in `input/charts/AxisType.js:259`

Returns an array of values based on an identifier key.

#### Parameters:

- `value` String

  value used to identify the array

#### Returns:

Object

### `getEdgeOffset`

(

- `ct`
- `l`

)

Defined in `input/charts/AxisType.js:357`

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/AxisType.js:240`

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:

Number

### `getLabelByIndex`

(

- `i`
- `l`

)

Defined in `input/charts/AxisType.js:371`

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/AxisType.js:334`

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/AxisType.js:434`

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

#### Returns:

String

### `getMinimumValue`

()

Defined in `input/charts/AxisType.js:422`

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

#### Returns:

String

### `getTotalMajorUnits`

()

Defined in `input/charts/AxisType.js:312`

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

#### Returns:

Number

### `initializer`

() private

Defined in `input/charts/AxisType.js:10`

### `removeKey`

(

- `value`

)

Defined in `input/charts/AxisType.js:223`

Removes an array from the key hash.

#### Parameters:

- `value` String

  Indicates what key to use in removing from the hash.

## Properties

### `_data`

Array private

Defined in `input/charts/AxisType.js:115`

Reference to data array.

### `_dataMaximum`

Object private

Defined in `input/charts/AxisType.js:97`

Storage for `dataMaximum` attribute.

### `_dataReady`

Boolean private

Defined in `input/charts/AxisType.js:133`

Storage for `dataReady` attribute.

### `_setMaximum`

Object private

Defined in `input/charts/AxisType.js:88`

Storage for `setMaximum` attribute.

### `_setMinimum`

Object private

Defined in `input/charts/AxisType.js:106`

Storage for `setMinimum` attribute.

### `_type`

String private

Defined in `input/charts/AxisType.js:78`

Type of data used in `Axis`.

### `_updateTotalDataFlag`

Boolean private

Defined in `input/charts/AxisType.js:124`

Indicates whether the all data is up to date.

### `GUID`

String private

Defined in `input/charts/AxisType.js:69`

Constant used to generate unique id.

## Attributes

### `data`

Array

Defined in `input/charts/AxisType.js:669`

Array of axis data

### `dataMaximum`

Number

Defined in `input/charts/AxisType.js:544`

The maximum value contained in the `data` array. Used for `maximum` when `autoMax` is true.

### `dataMinimum`

Number

Defined in `input/charts/AxisType.js:594`

The minimum value contained in the `data` array. Used for `minimum` when `autoMin` is true.

### `dataProvider`

Array

Defined in `input/charts/AxisType.js:530`

Instance of `ChartDataProvider` that the class uses to build its own data.

### `keyCollection`

Array

Defined in `input/charts/AxisType.js:686`

Array containing all the keys in the axis.

### `keys`

Object

Defined in `input/charts/AxisType.js:447`

Hash of array identifed by a string value.

### `maximum`

Number

Defined in `input/charts/AxisType.js:562`

The maximum value that will appear on an axis.

### `minimum`

Number

Defined in `input/charts/AxisType.js:612`

The minimum value that will appear on an axis.

### `roundingMethod`

String

Defined in `input/charts/AxisType.js:491`

Indicates how to round unit values.

niceNumber
  Units will be smoothed based on the number of ticks and data range.
auto
  If the range is greater than 1, the units will be rounded.
numeric value
  Units will be equal to the numeric value.
null
  No rounding will occur.

Default: niceNumber

### `setMax`

Boolean

Defined in `input/charts/AxisType.js:637`

Determines whether the maximum is calculated or explicitly set by the user.

### `setMin`

Boolean

Defined in `input/charts/AxisType.js:653`

Determines whether the minimum is calculated or explicitly set by the user.

### `type`

String

Defined in `input/charts/AxisType.js:508`

Returns the type of axis data

time
  Manages time data
stacked
  Manages stacked numeric data
numeric
  Manages numeric data
category
  Manages categorical data