API Docs for: 3.8.0
Show:

PieChart Class

Module: charts-base
Parent Module: charts

The PieChart class creates a pie chart

Methods

_addAxes

() private

Adds axes to the chart.

_addSeries

() private

Renders the Graph.

_getAriaMessage

(
  • key
)

Returns the appropriate message based on the key press.

Parameters:

  • key Number

    The keycode that was pressed.

Returns:

String

_getDefaultAxes

() private

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

Returns:

Object

_getSeriesCollection

() private

Calculates and returns a seriesCollection.

Returns:

Array

_parseAxes

(
  • val
)
private

Creates Axis instances.

Parameters:

  • val Object

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

Returns:

Object

_parseSeriesAxes

(
  • c
)
private

Parse and sets the axes for the chart.

Parameters:

  • c Array

    A collection PieSeries instance.

_redraw

() private

Redraws the chart instance.

_sizeChanged

(
  • e
)
private

Handler for sizeChanged event.

Parameters:

_tooltipLabelFunction

(
  • categoryItem
  • valueItem
  • itemIndex
  • series
  • seriesIndex
)
HTML private

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
)

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

Sets the aria description for the chart.

Fires event ariaDescriptionChange

Fires when the value for the configuration attribute ariaDescription 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:

  • e EventFacade
    An Event Facade object with the following attribute-specific properties added:
    • prevVal Any
      The value of the attribute, prior to it being set.
    • newVal Any
      The value the attribute is to be set to.
    • attrName String
      The name of the attribute being set.
    • subAttrName String
      If setting a property within the attribute's value, the name of the sub-attribute property being set.

axes

Object

Axes to appear in the chart.

Fires event axesChange

Fires when the value for the configuration attribute axes 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:

  • e EventFacade
    An Event Facade object with the following attribute-specific properties added:
    • prevVal Any
      The value of the attribute, prior to it being set.
    • newVal Any
      The value the attribute is to be set to.
    • attrName String
      The name of the attribute being set.
    • subAttrName String
      If setting a property within the attribute's value, the name of the sub-attribute property being set.

seriesCollection

Array

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.

Fires event seriesCollectionChange

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:

  • e EventFacade
    An Event Facade object with the following attribute-specific properties added:
    • prevVal Any
      The value of the attribute, prior to it being set.
    • newVal Any
      The value the attribute is to be set to.
    • attrName String
      The name of the attribute being set.
    • subAttrName String
      If setting a property within the attribute's value, the name of the sub-attribute property being set.

type

String

Type of chart when there is no series collection specified.

Fires event typeChange

Fires when the value for the configuration attribute type 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:

  • e EventFacade
    An Event Facade object with the following attribute-specific properties added:
    • prevVal Any
      The value of the attribute, prior to it being set.
    • newVal Any
      The value the attribute is to be set to.
    • attrName String
      The name of the attribute being set.
    • subAttrName String
      If setting a property within the attribute's value, the name of the sub-attribute property being set.