# Class: Chart

## RichFaces.ui. Chart

#### new Chart(componentId, options)

Backing object for rich:chart

##### Parameters:

Name | Type | Description
--- | --- | ---
`componentId` |  |
`options` |  |

Source:
  - chart.js, line 266

### Extends

- RichFaces.BaseComponent

### Members

#### name :string

Component name.

##### Type:

- string

Inherited From:
  - RichFaces.BaseComponent#name
Source:
  - richfaces-base-component.js, line 195

### Methods

#### attachToDom(source) → {DOMElement}

Attach component object to DOM element by component id, DOM element or jQuery object and returns the element Its required for the client side API calls and to clean up after ajax request or document unload by calling destroy method

##### Parameters:

Name | Type | Description
--- | --- | ---
`source` | string | DOMElement | jQuery | component id, DOM element or DOM elements wrapped by jQuery

Inherited From:
  - RichFaces.BaseComponent#attachToDom
Source:
  - richfaces-base-component.js, line 237

##### Returns:

Type
  DOMElement

#### destroy()

Destroy method. Will be called before remove component from the page

Inherited From:
  - RichFaces.BaseComponent#destroy
Source:
  - richfaces-base-component.js, line 313

#### detach(source)

Detach component object from DOM element by component id, DOM element or jQuery object

##### Parameters:

Name | Type | Description
--- | --- | ---
`source` | string | DOMElement | jQuery | component id, DOM element or DOM elements wrapped by jQuery

Inherited From:
  - RichFaces.BaseComponent#detach
Source:
  - richfaces-base-component.js, line 258

#### getEventElement() → {string}

Method returns element's id for event handlers binding. Event API calls this method when binding by component object as selector was used.

Inherited From:
  - RichFaces.BaseComponent#getEventElement
Source:
  - richfaces-base-component.js, line 224

##### Returns:

Type
  string

#### getPlotObject() → {Plot}

Returns chart object

Source:
  - chart.js, line 310

##### Returns:

chart object

Type
  Plot

#### highlight(seriesIndex, pointIndex)

Highlights the point in chart selected by seriesIndex or point index. Does not work for pie charts.

##### Parameters:

Name | Type | Description
--- | --- | ---
`seriesIndex` | int | index of the series
`pointIndex` | int | index of the point

Source:
  - chart.js, line 321

#### invokeEvent(eventType, element, event, data) → {boolean}

Invokes event on on the DOM element

##### Parameters:

Name | Type | Description
--- | --- | ---
`eventType` | string | event type, e.g. "click"
`element` | DOMElement | DOM element object
`event` | Event | jQuery Event
`data` | Object | additional data used for event handler

Inherited From:
  - RichFaces.BaseComponent#invokeEvent
Source:
  - richfaces-base-component.js, line 272

##### Returns:

true if an event is successfully invoked

Type
  boolean

#### resetZoom()

Reset the zoom level

Source:
  - chart.js, line 453

#### toString() → {string}

Method for converting object to string

Inherited From:
  - RichFaces.BaseComponent#toString
Source:
  - richfaces-base-component.js, line 203

##### Returns:

Type
  string

#### unhighlight(seriesIndex, pointIndex)

Removes highlighting of point. If method is called without parameters it unhighlights all points.

##### Parameters:

Name | Type | Description
--- | --- | ---
`seriesIndex` | int | index of the series
`pointIndex` | int | index of the point

Source:
  - chart.js, line 332