API Docs for: 3.5.1
Show:

TimeAxis Class

Module: charts

TimeAxis manages time data on an axis.

Methods

_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

_getNumber

(
  • val
)
private

Parses value into a number.

Parameters:

  • val Object

    Value to parse into a number

Returns:

Number

_setDataByKey

(
  • key
  • data
)
private

Sets data by key

Parameters:

  • key String

    Key value to use.

  • data Array

    Array to use.

formatLabel

(
  • value
  • format
)

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
)

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

Type of data used in Axis.

GUID

String private

Constant used to generate unique id.

Attributes

labelFormat

String

Pattern used by the labelFunction to format a label.

Fires event labelFormatChange

Fires when the value for the configuration attribute labelFormat 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.

labelFunction

Function

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)

Fires event labelFunctionChange

Fires when the value for the configuration attribute labelFunction 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. Unless explicitly set, this value is calculated by the 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. Unless explicitly set, this value is calculated by the 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.

setMax

Boolean private

Indicates whether the maximum is calculated or explicitly set.

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 private

Indicates whether the minimum is calculated or explicitly set.

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.