API Docs for: 3.8.0
Show:

Gridlines Class

Module: charts-base
Parent Module: charts

Gridlines draws gridlines on a Graph.

Methods

_drawGridlines

() private

Algorithm for drawing gridlines

_getDefaultStyles

() protected

Gets the default value for the styles attribute. Overrides base implementation.

Returns:

Object

_horizontalLine

(
  • path
  • pt
  • w
  • h
)
private

Algorithm for horizontal lines.

Parameters:

  • path Path

    Reference to path element

  • pt Object

    Coordinates corresponding to a major unit of an axis.

  • w Number

    Width of the Graph

  • h Number

    Height of the Graph

_verticalLine

(
  • path
  • pt
  • w
  • h
)
private

Algorithm for vertical lines.

Parameters:

  • path Path

    Reference to path element

  • pt Object

    Coordinates corresponding to a major unit of an axis.

  • w Number

    Width of the Graph

  • h Number

    Height of the Graph

draw

() protected

Draws the gridlines

remove

() private

Removes the Gridlines.

Properties

_path

Path private

Reference to the Path element used for drawing Gridlines.

Attributes

axis

Axis

Indicate the Axis in which to bind the gridlines.

Fires event axisChange

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

direction

String

Indicates the direction of the gridline.

Fires event directionChange

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

graph

Graph

Indicates the Graph in which the gridlines are drawn.

Fires event graphChange

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