API Docs for: 3.8.0
Show:

AxisType Class

Module: charts-base
Parent Module: charts

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

Methods

_dataProviderChangeHandler

(
  • e
)
private

Handles changes to dataProvider.

Parameters:

_getKeyArray

(
  • key
  • data
)
private

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

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

Updates the Axis after a change in keys.

Parameters:

_setDataByKey

(
  • key
  • data
)
private

Sets data by key

Parameters:

  • key String

    Key value to use.

  • data Array

    Array to use.

_updateMinAndMax

() private

Calculates the maximum and minimum values for the Axis.

_updateTotalData

() private

Updates the total data array.

addKey

(
  • value
)

Adds an array to the key hash.

Parameters:

  • value Object

    Indicates what key to use in retrieving the array.

bindUI

() private

getDataByKey

(
  • value
)

Returns an array of values based on an identifier key.

Parameters:

  • value String

    value used to identify the array

Returns:

Object

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

getKeyValueAt

(
  • key
  • index
)

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
)

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
)

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

()

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

Returns:

String

getMinimumValue

()

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

Returns:

String

getTotalMajorUnits

()

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

Returns:

Number

initializer

() private

removeKey

(
  • value
)

Removes an array from the key hash.

Parameters:

  • value String

    Indicates what key to use in removing from the hash.

Properties

_data

Array private

Reference to data array.

_dataMaximum

Object private

Storage for dataMaximum attribute.

_dataReady

Boolean private

Storage for dataReady attribute.

_setMaximum

Object private

Storage for setMaximum attribute.

_setMinimum

Object private

Storage for setMinimum attribute.

_type

String private

Type of data used in Axis.

_updateTotalDataFlag

Boolean private

Indicates whether the all data is up to date.

GUID

String private

Constant used to generate unique id.

Attributes

data

Array

Array of axis data

Fires event dataChange

Fires when the value for the configuration attribute data 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:

  • e EventFacade
    An Event Facade object with the following attribute-specific properties added:
    • prevVal Any
      The value of the attribute, prior to it being set.
    • newVal Any
      The value the attribute is to be set to.
    • attrName String
      The name of the attribute being set.
    • subAttrName String
      If setting a property within the attribute's value, the name of the sub-attribute property being set.

dataMaximum

Number

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

Fires event dataMaximumChange

Fires when the value for the configuration attribute dataMaximum 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:

  • e EventFacade
    An Event Facade object with the following attribute-specific properties added:
    • prevVal Any
      The value of the attribute, prior to it being set.
    • newVal Any
      The value the attribute is to be set to.
    • attrName String
      The name of the attribute being set.
    • subAttrName String
      If setting a property within the attribute's value, the name of the sub-attribute property being set.

dataMinimum

Number

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

Fires event dataMinimumChange

Fires when the value for the configuration attribute dataMinimum 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:

  • e EventFacade
    An Event Facade object with the following attribute-specific properties added:
    • prevVal Any
      The value of the attribute, prior to it being set.
    • newVal Any
      The value the attribute is to be set to.
    • attrName String
      The name of the attribute being set.
    • subAttrName String
      If setting a property within the attribute's value, the name of the sub-attribute property being set.

dataProvider

Array

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

Fires event dataProviderChange

Fires when the value for the configuration attribute dataProvider 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:

  • e EventFacade
    An Event Facade object with the following attribute-specific properties added:
    • prevVal Any
      The value of the attribute, prior to it being set.
    • newVal Any
      The value the attribute is to be set to.
    • attrName String
      The name of the attribute being set.
    • subAttrName String
      If setting a property within the attribute's value, the name of the sub-attribute property being set.

keyCollection

Array

Array containing all the keys in the axis.

Fires event keyCollectionChange

Fires when the value for the configuration attribute keyCollection 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:

  • e EventFacade
    An Event Facade object with the following attribute-specific properties added:
    • prevVal Any
      The value of the attribute, prior to it being set.
    • newVal Any
      The value the attribute is to be set to.
    • attrName String
      The name of the attribute being set.
    • subAttrName String
      If setting a property within the attribute's value, the name of the sub-attribute property being set.

keys

Object

Hash of array identifed by a string value.

Fires event keysChange

Fires when the value for the configuration attribute keys 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:

  • e EventFacade
    An Event Facade object with the following attribute-specific properties added:
    • prevVal Any
      The value of the attribute, prior to it being set.
    • newVal Any
      The value the attribute is to be set to.
    • attrName String
      The name of the attribute being set.
    • subAttrName String
      If setting a property within the attribute's value, the name of the sub-attribute property being set.

maximum

Number

The maximum value that will appear on an axis.

Fires event maximumChange

Fires when the value for the configuration attribute maximum 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:

  • e EventFacade
    An Event Facade object with the following attribute-specific properties added:
    • prevVal Any
      The value of the attribute, prior to it being set.
    • newVal Any
      The value the attribute is to be set to.
    • attrName String
      The name of the attribute being set.
    • subAttrName String
      If setting a property within the attribute's value, the name of the sub-attribute property being set.

minimum

Number

The minimum value that will appear on an axis.

Fires event minimumChange

Fires when the value for the configuration attribute minimum 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:

  • e EventFacade
    An Event Facade object with the following attribute-specific properties added:
    • prevVal Any
      The value of the attribute, prior to it being set.
    • newVal Any
      The value the attribute is to be set to.
    • attrName String
      The name of the attribute being set.
    • subAttrName String
      If setting a property within the attribute's value, the name of the sub-attribute property being set.

roundingMethod

String

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

Fires event roundingMethodChange

Fires when the value for the configuration attribute roundingMethod 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:

  • e EventFacade
    An Event Facade object with the following attribute-specific properties added:
    • prevVal Any
      The value of the attribute, prior to it being set.
    • newVal Any
      The value the attribute is to be set to.
    • attrName String
      The name of the attribute being set.
    • subAttrName String
      If setting a property within the attribute's value, the name of the sub-attribute property being set.

setMax

Boolean

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

Fires event setMaxChange

Fires when the value for the configuration attribute setMax 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:

  • e EventFacade
    An Event Facade object with the following attribute-specific properties added:
    • prevVal Any
      The value of the attribute, prior to it being set.
    • newVal Any
      The value the attribute is to be set to.
    • attrName String
      The name of the attribute being set.
    • subAttrName String
      If setting a property within the attribute's value, the name of the sub-attribute property being set.

setMin

Boolean

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

Fires event setMinChange

Fires when the value for the configuration attribute setMin 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:

  • e EventFacade
    An Event Facade object with the following attribute-specific properties added:
    • prevVal Any
      The value of the attribute, prior to it being set.
    • newVal Any
      The value the attribute is to be set to.
    • attrName String
      The name of the attribute being set.
    • subAttrName String
      If setting a property within the attribute's value, the name of the sub-attribute property being set.

type

String

Returns the type of axis data

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

Fires event typeChange

Fires when the value for the configuration attribute type 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:

  • e EventFacade
    An Event Facade object with the following attribute-specific properties added:
    • prevVal Any
      The value of the attribute, prior to it being set.
    • newVal Any
      The value the attribute is to be set to.
    • attrName String
      The name of the attribute being set.
    • subAttrName String
      If setting a property within the attribute's value, the name of the sub-attribute property being set.