#

API Docs for:
Show: Inherited Protected Private Deprecated

# PieChart Class

Defined in: `input/charts/PieChart.js:1`
Module: charts

The PieChart class creates a pie chart

- Index
- Methods
- Attributes

## Item Index

### Methods

- _addAxes
- _addSeries
- _getAriaMessage
- _getDefaultAxes
- _getSeriesCollection
- _parseAxes
- _parseSeriesAxes
- _redraw
- _sizeChanged
- _tooltipLabelFunction
- getSeriesItem

### Attributes

- ariaDescription
- axes
- seriesCollection
- type

## Methods

### `_addAxes`

() private

Defined in `input/charts/PieChart.js:105`

Adds axes to the chart.

### `_addSeries`

() private

Defined in `input/charts/PieChart.js:145`

Renders the Graph.

### `_getAriaMessage`

(

- `key`

)

Defined in `input/charts/PieChart.js:345`

Returns the appropriate message based on the key press.

#### Parameters:

- `key` Number

  The keycode that was pressed.

#### Returns:

String

### `_getDefaultAxes`

() private

Defined in `input/charts/PieChart.js:209`

Generates and returns a key-indexed object containing `Axis` instances or objects used to create `Axis` instances.

#### Returns:

Object

### `_getSeriesCollection`

() private

Defined in `input/charts/PieChart.js:10`

Calculates and returns a `seriesCollection`.

#### Returns:

Array

### `_parseAxes`

(

- `val`

)
private

Defined in `input/charts/PieChart.js:52`

Creates `Axis` instances.

#### Parameters:

- `val` Object

  Object containing `Axis` instances or objects in which to construct `Axis` instances.

#### Returns:

Object

### `_parseSeriesAxes`

(

- `c`

)
private

Defined in `input/charts/PieChart.js:164`

Parse and sets the axes for the chart.

#### Parameters:

- `c` Array

  A collection `PieSeries` instance.

### `_redraw`

() private

Defined in `input/charts/PieChart.js:286`

Redraws the chart instance.

### `_sizeChanged`

(

- `e`

)
private

Defined in `input/charts/PieChart.js:274`

Handler for sizeChanged event.

#### Parameters:

- `e` Object

  Event object.

### `_tooltipLabelFunction`

(

- `categoryItem`
- `valueItem`
- `itemIndex`
- `series`
- `seriesIndex`

)
HTML private

Defined in `input/charts/PieChart.js:306`

Formats tooltip text for a pie chart.

#### Parameters:

- `categoryItem` Object

  An object containing the following:

  axis
    The axis to which the category is bound.
  displayName
    The display name set to the category (defaults to key if not provided)
  key
    The key of the category.
  value
    The value of the category
- `valueItem` Object

  An object containing the following:

  axis
    The axis to which the item's series is bound.
  displayName
    The display name of the series. (defaults to key if not provided)
  key
    The key for the series.
  value
    The value for the series item.
- `itemIndex` Number

  The index of the item within the series.

- `series` CartesianSeries

  The `PieSeries` instance of the item.

- `seriesIndex` Number

  The index of the series in the `seriesCollection`.

#### Returns:

HTML:

### `getSeriesItem`

(

- `series`
- `index`

)

Defined in `input/charts/PieChart.js:249`

Returns an object literal containing a categoryItem and a valueItem for a given series index.

#### Parameters:

- `series` Object

  Reference to a series.

- `index` Object

  Index of the specified item within a series.

#### Returns:

Object

## Attributes

### `ariaDescription`

String

Defined in `input/charts/PieChart.js:398`

Sets the aria description for the chart.

### `axes`

Object

Defined in `input/charts/PieChart.js:418`

Axes to appear in the chart.

### `seriesCollection`

Array

Defined in `input/charts/PieChart.js:436`

Collection of series to appear on the chart. This can be an array of Series instances or object literals used to describe a Series instance.

### `type`

String

Defined in `input/charts/PieChart.js:455`

Type of chart when there is no series collection specified.