#

API Docs for:
Show: Inherited Protected Private Deprecated

# TimeAxis Class

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

TimeAxis manages time data on an axis.

- Index
- Methods
- Properties
- Attributes

## Item Index

### Methods

- _getKeyArray
- _getNumber
- _setDataByKey
- formatLabel
- getLabelByIndex

### Properties

- _dataType
- GUID

### Attributes

- labelFormat
- labelFunction
- maximum
- minimum
- setMax
- setMin

## Methods

### `_getKeyArray`

(

- `key`
- `data`

)
private

Defined in `input/charts/TimeAxis.js:203`

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

### `_getNumber`

(

- `val`

)
private

Defined in `input/charts/TimeAxis.js:314`

Parses value into a number.

#### Parameters:

- `val` Object

  Value to parse into a number

#### Returns:

Number

### `_setDataByKey`

(

- `key`
- `data`

)
private

Defined in `input/charts/TimeAxis.js:258`

Sets data by key

#### Parameters:

- `key` String

  Key value to use.

- `data` Array

  Array to use.

### `formatLabel`

(

- `value`
- `format`

)

Defined in `input/charts/TimeAxis.js:138`

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

### `getLabelByIndex`

(

- `i`
- `l`

)

Defined in `input/charts/TimeAxis.js:174`

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

## Properties

### `_dataType`

Unknown private

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

Type of data used in `Axis`.

### `GUID`

String private

Defined in `input/charts/TimeAxis.js:156`

Constant used to generate unique id.

## Attributes

### `labelFormat`

String

Defined in `input/charts/TimeAxis.js:126`

Pattern used by the `labelFunction` to format a label.

### `labelFunction`

Function

Defined in `input/charts/TimeAxis.js:101`

Method used for formatting a label. This attribute allows for the default label formatting method to overridden. The method use would need to implement the arguments below and return a `String` or an `HTMLElement`. The default implementation of the method returns a `String`. The output of this method will be rendered to the DOM using `appendChild`. If you override the `labelFunction` method and return an html string, you will also need to override the Axis' `appendLabelFunction` to accept html as a `String`.

val
  Label to be formatted. (`String`)
format
  STRFTime string used to format the label. (optional)

### `maximum`

Number

Defined in `input/charts/TimeAxis.js:55`

The maximum value that will appear on an axis. Unless explicitly set, this value is calculated by the `Axis`.

### `minimum`

Number

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

The minimum value that will appear on an axis. Unless explicitly set, this value is calculated by the `Axis`.

### `setMax`

Boolean private readonly

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

Indicates whether the maximum is calculated or explicitly set.

### `setMin`

Boolean private readonly

Defined in `input/charts/TimeAxis.js:37`

Indicates whether the minimum is calculated or explicitly set.