Graph Class
Graph manages and contains series instances for a CartesianChart
instance.
Item Index
Methods
Methods
_addSeries
-
series
Adds a series to the graph.
Parameters:
-
series
CartesianSeriesSeries to add to the graph.
_drawingCompleteHandler
-
e
Event handler for series drawingComplete event.
Parameters:
-
e
ObjectEvent object.
_drawSeries
()
private
Draws each series.
_getDefaultStyles
()
protected
Gets the default value for the styles
attribute. Overrides
base implementation.
Returns:
_getSeries
-
type
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 Value | Class |
---|---|
line | Y.LineSeries |
column | Y.ColumnSeries |
bar | Y.BarSeries |
area | Y.AreaSeries |
stackedarea | Y.StackedAreaSeries |
stackedline | Y.StackedLineSeries |
stackedcolumn | Y.StackedColumnSeries |
stackedbar | Y.StackedBarSeries |
markerseries | Y.MarkerSeries |
spline | Y.SplineSeries |
areaspline | Y.AreaSplineSeries |
stackedspline | Y.StackedSplineSeries |
stackedareaspline | Y.StackedAreaSplineSeries |
stackedmarkerseries | Y.StackedMarkerSeries |
pie | Y.PieSeries |
combo | Y.ComboSeries |
stackedcombo | Y.StackedComboSeries |
combospline | Y.ComboSplineSeries |
stackedcombospline | Y.StackedComboSplineSeries |
When referencing a class directly, you can specify any of the above classes or any custom class that extends CartesianSeries
or PieSeries
.
Parameters:
-
type
String | ObjectSeries type.
Returns:
_markerEventHandler
-
e
Event handler for marker events.
Parameters:
-
e
ObjectEvent object.
_parseSeriesCollection
-
Collection
Parses series instances to be displayed in the graph.
Parameters:
-
Collection
Arrayof
CartesianSeries
instances or objects containerCartesianSeries
attributes values.
_sizeChangeHandler
-
e
Event handler for size changes.
Parameters:
-
e
ObjectEvent object.
_updateStyles
()
private
Updates the Graph
styles.
addDispatcher
-
val
Adds dispatcher to a _dispatcher
used to
to ensure all series have redrawn before for firing event.
Parameters:
-
val
CartesianSeriesseries instance to add
bindUI
()
private
createSeries
-
seriesData
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
ObjectSeries 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
Numberindex of the series
Returns:
getSeriesByKey
-
val
Returns a series instance based on a key value.
Parameters:
-
val
Stringkey value of the series
Returns:
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
groupMarkers
Boolean
Indicates whether or not markers for a series will be grouped and rendered in a single complex shape instance.
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.
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.