# Yahoo! UI Library

### Charts Widget 2.5.2

Yahoo! UI Library > charts > YAHOO.widget.PieChart

Show Private Show Protected

## Class YAHOO.widget.PieChart - uses YAHOO.widget.Chart

PieChart class for the YUI Charts widget.

### Constructor

YAHOO.widget.PieChart `( containerId , dataSource , attributes )`

Parameters:
  `containerId <HTMLElement>` Container element for the Flash Player instance.
  `dataSource <YAHOO.util.DataSource>` DataSource instance.
  `attributes <object>` (optional) Object literal of configuration values.

#### Properties inherited from YAHOO.widget.Chart:

`_dataSource, _dataTipFunction, _initialized, _pollingID, _pollingInterval, _request, _seriesDefs, _type`

### Methods

#### _getCategoryField

`private void _getCategoryField ( )`
Getter for the categoryField attribute.

Returns: `void`

#### _getDataField

`private void _getDataField ( )`
Getter for the dataField attribute.

Returns: `void`

#### _initAttributes

`private void _initAttributes ( )`
Initializes the attributes.

Returns: `void`

#### _setCategoryField

`private void _setCategoryField ( )`
Setter for the categoryField attribute.

Returns: `void`

#### _setDataField

`private void _setDataField ( )`
Setter for the dataField attribute.

Returns: `void`

#### Methods inherited from YAHOO.widget.Chart:

`_getCategoryNames, _getDataSource, _getPolling, _getRequest, _getSeriesDefs, _initAttributes, _loadDataHandler, _loadHandler, _refreshData, _setCategoryNames, _setDataSource, _setDataTipFunction, _setPolling, _setRequest, _setSeriesDefs, setSeriesStyles, setStyle, setStyles, toString`

### Events

#### beforeCategoryFieldChange

`beforeCategoryFieldChange ( eventInfo )`
Fires before the value for the configuration attribute 'categoryField' changes. Return false to cancel the attribute change.

Parameters:
  `eventInfo <{oldValue: any, newValue: any}>` An object containing the current attribute value and the new value.

#### beforeDataFieldChange

`beforeDataFieldChange ( eventInfo )`
Fires before the value for the configuration attribute 'dataField' changes. Return false to cancel the attribute change.

Parameters:
  `eventInfo <{oldValue: any, newValue: any}>` An object containing the current attribute value and the new value.

#### categoryFieldChange

`categoryFieldChange ( eventInfo )`
Fires when the value for the configuration attribute 'categoryField' changes.

Parameters:
  `eventInfo <{oldValue: any, newValue: any}>` An object containing the previous attribute value and the new value.

#### dataFieldChange

`dataFieldChange ( eventInfo )`
Fires when the value for the configuration attribute 'dataField' changes.

Parameters:
  `eventInfo <{oldValue: any, newValue: any}>` An object containing the previous attribute value and the new value.

#### Events inherited from YAHOO.widget.Chart:

`beforeCategoryNamesChange, beforeDataSourceChange, beforeDataTipFunctionChange, beforePollingChange, beforeRequestChange, beforeSeriesChange, categoryNamesChange, dataSourceChange, dataTipFunctionChange, itemClickEvent itemDoubleClickEvent itemDragEndEvent itemDragEvent itemDragStartEvent itemMouseOutEvent itemMouseOverEvent pollingChange requestChange seriesChange`

### Configuration Attributes

#### categoryField `- String`

The field in each item that corresponds to the category value.

#### dataField `- String`

The field in each item that corresponds to the data value.

#### Configuration attributes inherited from YAHOO.widget.Chart:

`categoryNames, dataSource, dataTipFunction, polling, request, series,`

Copyright © 2007 Yahoo! Inc. All rights reserved.