# Yahoo! UI Library

### charts 3.3.0

Yahoo! UI Library > charts > Graph
Search:
Filters Show Private Show Protected Show Deprecated

## Class Graph - extends Widget - uses Renderer

Graph manages and contains series instances for a `CartesianChart` instance.

### Constructor

Graph `( )`

### Properties

#### _dispatchers - `private object`

#### _seriesCollection - `private object`

Collection of series to be displayed in the graph.

#### _seriesDictionary - `private object`

#### seriesTypes - `private object`

Hash of arrays containing series mapped to a series type.

#### Properties inherited from Plugin.Host:

`PluginHost`

#### Properties inherited from Attribute:

``

#### Properties inherited from Widget:

`_UI_ATTRS, BOUNDING_TEMPLATE, CONTENT_TEMPLATE, DEF_PARENT_NODE, DEF_UNIT, UI_EVENTS`

#### Properties inherited from Base:

`name`

#### Properties inherited from Renderer:

`_styles`

### Methods

#### _addSeries

`private void _addSeries ( )`
Adds a series to the graph.

#### _createSeries

`private void _createSeries ( )`

#### _drawingCompleteHandler

`private void _drawingCompleteHandler ( )`

#### _drawSeries

`private void _drawSeries ( )`

#### _getDefaultStyles

`protected _getDefaultStyles ( )`
Gets the default value for the `styles` attribute. Overrides base implementation.

Returns: ``
  Object

#### _getSeries

`private void _getSeries ( )`

#### _markerEventHandler

`private void _markerEventHandler ( )`

#### _parseSeriesCollection

`private void _parseSeriesCollection ( )`
Parses series instances to be displayed in the graph.

#### _sizeChangeHandler

`private void _sizeChangeHandler ( )`

#### _updateStyles

`private void _updateStyles ( )`

#### addDispatcher

`protected void addDispatcher ( val )`
Adds dispatcher to a `_dispatcher` used to to ensure all series have redrawn before for firing event.

Parameters:
  `val <CartesianSeries>` series instance to add

#### getSeriesByIndex

`getSeriesByIndex ( val )`
Returns a series instance based on an index.

Parameters:
  `val <Number>` index of the series

Returns: ``
  CartesianSeries

#### getSeriesByKey

`getSeriesByKey ( val )`
Returns a series instance based on a key value.

Parameters:
  `val <String>` key value of the series

Returns: ``
  CartesianSeries

#### renderUI

`private void renderUI ( )`

#### syncUI

`private void syncUI ( )`

#### Methods inherited from Plugin.Host:

`_destroyPlugins, _initPlugins, hasPlugin, plug, unplug`

#### Methods inherited from Widget:

`_applyParsedConfig, _applyParser, _bindAttrUI, _bindDOM, _bindUI, _createUIEvent, _defaultCB, _defRenderFn, _destroyUIEvents, _getHtmlParser, _getSrcNode, _getStrings, _getUIEventNode, _guid, _initUIEvent, _isUIEvent, _onDocFocus, _onDocMouseDown, _removeLoadingClassNames, _renderBox, _renderBoxClassNames, _renderUI, _setAttrUI, _setBB, _setBox, _setCB, _setStrings, _strSetter, _syncAttrUI, _syncUI, _uiSetDim, _uiSetDisabled, _uiSetFocused, _uiSetHeight, _uiSetTabIndex, _uiSetVisible, _uiSetWidth, _uiSizeCB, _unbindDOM, _unbindUI, _validTabIndex, bindUI, blur, destructor, disable, enable, focus, getClassName, getDefaultLocale, getSkinName, getString, getStrings, hide, initializer, render, renderer, renderUI, show, syncUI, toString`

#### Methods inherited from Attribute:

`_addAttrs, _addLazyAttr, _defAttrChangeFn, _fireAttrChange, _getAttr, _getAttrCfg, _getAttrInitVal, _getAttrs, _getStateVal, _isLazyAttr, _normAttrVals, _protectAttrs, _set, _setAttr, _setAttrs, _setAttrVal, _setStateVal, addAttr, addAttrs, attrAdded, get, getAttrs, modifyAttr, removeAttr, reset, set, setAttrs`

#### Methods inherited from EventTarget:

`_getType, _monitor, _parseType, addTarget, after, before, bubble, detach, detachAll, fire, getEvent, getTargets, on, once, parseType, publish, removeTarget, subscribe, unsubscribe, unsubscribeAll`

#### Methods inherited from Base:

`_aggregateAttrs, _defDestroyFn, _defInitFn, _destroyHierarchy, _filterAttrCfs, _getAttrCfgs, _getClasses, _initHierarchy, _initHierarchyData, _preInitEventCfg, destroy, init, toString`

#### Methods inherited from Renderer:

`_getDefaultStyles, _mergeStyles, _setStyles`

### Events

#### horizontalGridlinesChange

`horizontalGridlinesChange ( event )`
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:
  `event <Event.Facade>` An Event Facade object with the following attribute specific properties added:
  prevVal
    The value of the attribute, prior to it being set
  newVal
    The value the attribute is to be set to
  attrName
    The name of the attribute being set
  subAttrName
    If setting a property within the attribute's value, the name of the sub-attribute property being set

#### seriesCollectionChange

`seriesCollectionChange ( event )`
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:
  `event <Event.Facade>` An Event Facade object with the following attribute specific properties added:
  prevVal
    The value of the attribute, prior to it being set
  newVal
    The value the attribute is to be set to
  attrName
    The name of the attribute being set
  subAttrName
    If setting a property within the attribute's value, the name of the sub-attribute property being set

#### seriesDictionaryChange

`seriesDictionaryChange ( event )`
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:
  `event <Event.Facade>` An Event Facade object with the following attribute specific properties added:
  prevVal
    The value of the attribute, prior to it being set
  newVal
    The value the attribute is to be set to
  attrName
    The name of the attribute being set
  subAttrName
    If setting a property within the attribute's value, the name of the sub-attribute property being set

#### showBackgroundChange

`showBackgroundChange ( event )`
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:
  `event <Event.Facade>` An Event Facade object with the following attribute specific properties added:
  prevVal
    The value of the attribute, prior to it being set
  newVal
    The value the attribute is to be set to
  attrName
    The name of the attribute being set
  subAttrName
    If setting a property within the attribute's value, the name of the sub-attribute property being set

#### stylesChange

`stylesChange ( event )`
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:
  `event <Event.Facade>` An Event Facade object with the following attribute specific properties added:
  prevVal
    The value of the attribute, prior to it being set
  newVal
    The value the attribute is to be set to
  attrName
    The name of the attribute being set
  subAttrName
    If setting a property within the attribute's value, the name of the sub-attribute property being set

#### verticalGridlinesChange

`verticalGridlinesChange ( event )`
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:
  `event <Event.Facade>` An Event Facade object with the following attribute specific properties added:
  prevVal
    The value of the attribute, prior to it being set
  newVal
    The value the attribute is to be set to
  attrName
    The name of the attribute being set
  subAttrName
    If setting a property within the attribute's value, the name of the sub-attribute property being set

#### Events inherited from Widget:

`boundingBoxChange, contentBoxChange, disabledChange, focusedChange, heightChange, idChange, localeChange, renderChange, renderedChange, srcNodeChange, stringsChange, tabIndexChange, visibleChange, widget:contentUpdate, widget:render, widthChange,`

#### Events inherited from Base:

`destroy, destroyedChange, init, initializedChange,`

#### Events inherited from Renderer:

`graphicChange, stylesChange`

### Configuration Attributes

#### horizontalGridlines `- Gridlines`

Reference to the horizontal `Gridlines` instance.
Default Value: null

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

#### seriesDictionary `- Object`

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

#### showBackground `- Boolean`

Indicates whether the `Graph` has a background.
Default Value: true

#### styles `- Object`

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

fill
  A hash containing 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
  A hash containing 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.

#### verticalGridlines `- Gridlines`

Reference to the vertical `Gridlines` instance.
Default Value: null

#### Configuration attributes inherited from Widget:

`boundingBox, contentBox, disabled, focused, height, id, locale render rendered srcNode strings tabIndex visible width`

#### Configuration attributes inherited from Base:

`destroyed initialized`

#### Configuration attributes inherited from Renderer:

`graphic styles`

Copyright © 2011 Yahoo! Inc. All rights reserved.