API Docs for: 3.8.0
Show:

Graph Class

Defined in: charts/js/Graph.js:1
Module: charts-base
Parent Module: charts

Graph manages and contains series instances for a CartesianChart instance.

Methods

_addSeries

(
  • series
)
private

Adds a series to the graph.

Parameters:

_drawingCompleteHandler

(
  • e
)
private

Event handler for series drawingComplete event.

Parameters:

_drawSeries

() private

Draws each series.

_getDefaultStyles

() protected

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

Returns:

Object

_getSeries

(
  • type
)
private

Returns a specific CartesianSeries class based on key value from a look up table of a direct reference to a class. When specifying a key value, the following options are available:

Key ValueClass
lineY.LineSeries
columnY.ColumnSeries
barY.BarSeries
areaY.AreaSeries
stackedareaY.StackedAreaSeries
stackedlineY.StackedLineSeries
stackedcolumnY.StackedColumnSeries
stackedbarY.StackedBarSeries
markerseriesY.MarkerSeries
splineY.SplineSeries
areasplineY.AreaSplineSeries
stackedsplineY.StackedSplineSeries
stackedareasplineY.StackedAreaSplineSeries
stackedmarkerseriesY.StackedMarkerSeries
pieY.PieSeries
comboY.ComboSeries
stackedcomboY.StackedComboSeries
combosplineY.ComboSplineSeries
stackedcombosplineY.StackedComboSplineSeries

When referencing a class directly, you can specify any of the above classes or any custom class that extends CartesianSeries or PieSeries.

Parameters:

Returns:

CartesianSeries

_markerEventHandler

(
  • e
)
private

Event handler for marker events.

Parameters:

_parseSeriesCollection

(
  • Collection
)
private

Parses series instances to be displayed in the graph.

Parameters:

  • Collection Array

    of CartesianSeries instances or objects container CartesianSeries attributes values.

_sizeChangeHandler

(
  • e
)
private

Event handler for size changes.

Parameters:

_updateStyles

() private

Updates the Graph styles.

addDispatcher

(
  • val
)
protected

Adds dispatcher to a _dispatcher used to to ensure all series have redrawn before for firing event.

Parameters:

bindUI

() private

createSeries

(
  • seriesData
)
private

Creates a CartesianSeries instance from an object containing attribute key value pairs. The key value pairs include attributes for the specific series and a type value which defines the type of series to be used.

Parameters:

  • seriesData Object

    Series attribute key value pairs.

destructor

() protected

Destructor implementation Graph class. Removes all Graphic instances from the widget.

getSeriesByIndex

(
  • val
)

Returns a series instance based on an index.

Parameters:

  • val Number

    index of the series

Returns:

CartesianSeries

getSeriesByKey

(
  • val
)

Returns a series instance based on a key value.

Parameters:

  • val String

    key value of the series

Returns:

CartesianSeries

syncUI

() private

Properties

_dispatchers

Array private

Collection of CartesianSeries instances to be redrawn.

_seriesCollection

Array private

Collection of series to be displayed in the graph.

_seriesDictionary

Object private

Object containing key value pairs of CartesianSeries instances.

_seriesMap

Object private

String reference for pre-defined Series classes.

seriesTypes

Object private

Object of arrays containing series mapped to a series type.

Attributes

background

Graphic readonly

Reference to graphic instance used for the background.

Fires event backgroundChange

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

chart

ChartBase readonly

Reference to the chart instance using the graph.

Fires event chartChange

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

graphic

Graphic readonly

Reference to graphic instance used for series.

Fires event graphicChange

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

gridlines

Graphic readonly

Reference to graphic instance used for gridlines.

Fires event gridlinesChange

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

groupMarkers

Boolean

Indicates whether or not markers for a series will be grouped and rendered in a single complex shape instance.

Fires event groupMarkersChange

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

horizontalGridlines

Gridlines

Reference to the horizontal Gridlines instance.

Default: null

Fires event horizontalGridlinesChange

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

seriesCollection

CartesianSeries

Collection of series. When setting the seriesCollection the array can contain a combination of either CartesianSeries instances or object literals with properties that will define a series.

Fires event seriesCollectionChange

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

seriesDictionary

Object readonly

Read-only hash lookup for all series on in the Graph.

Fires event seriesDictionaryChange

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

showBackground

Boolean

Indicates whether the Graph has a background.

Default: true

Fires event showBackgroundChange

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

styles

Object

Style properties used for drawing a background. Below are the default values:

background
An object containing the following values:
fill
Defines the style properties for the fill. Contains the following values:
color
Color of the fill. The default value is #faf9f2.
alpha
Number from 0 to 1 indicating the opacity of the background fill. The default value is 1.
border
Defines the style properties for the border. Contains the following values:
color
Color of the border. The default value is #dad8c9.
alpha
Number from 0 to 1 indicating the opacity of the background border. The default value is 1.
weight
Number indicating the width of the border. The default value is 1.

Fires event stylesChange

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

verticalGridlines

Gridlines

Reference to the vertical Gridlines instance.

Default: null

Fires event verticalGridlinesChange

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

x

Number protected

The x-coordinate for the graph.

Fires event xChange

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

y

Number protected

The y-coordinate for the graph.

Fires event yChange

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