Version 3.18.1
Show:

CategoryImpl Class

Module: axis-category-base
Parent Module: charts

CategoryImpl contains logic for managing category data. CategoryImpl is used by the following classes:

Constructor

CategoryImpl

()

Methods

_getCoordFromValue

(
  • min
  • max
  • length
  • dataValue
  • offset
  • reverse
)
private

Returns a coordinate corresponding to a data values.

Parameters:

  • min Number

    The minimum for the axis.

  • max Number

    The maximum for the axis.

  • length Number

    The distance that the axis spans.

  • dataValue Number

    A value used to ascertain the coordinate.

  • offset Number

    Value in which to offset the coordinates.

  • reverse Boolean

    Indicates whether the coordinates should start from the end of an axis. Only used in the numeric implementation.

Returns:

Number

_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

_updateMinAndMax

() private

Calculates the maximum and minimum values for the Data.

formatLabel

(
  • value
)

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

Parameters:

Returns:

String

getDataByKey

(
  • value
)

Returns an array of values based on an identifier key.

Parameters:

  • value String

    value used to identify the array

Returns:

Array

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:

String

getTotalMajorUnits

(
  • majorUnit
  • len
)

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

Type of data used in Data.

_indices

Unknown private

Object storing key data.

GUID

String private

Constant used to generate unique id.

Attributes

calculateEdgeOffset

Boolean

Determines whether and offset is automatically calculated for the edges of the axis.

Fires event calculateEdgeOffsetChange

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

labelFormat

Object

Pattern used by the labelFunction to format a label. The default labelFunction values for CategoryAxis and CategoryAxisBase do not accept a format object. This value can be used by a custom method.

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 HTMLElement.

val
Label to be formatted. (String)
format
Template for formatting 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.