Sencha Documentation

Creates a Pie Chart. A Pie Chart is a useful visualization technique to display quantitative information for different categories that also have a meaning as a whole. As with all other series, the Pie Series must be appended in the *series* Chart array configuration. See the Chart documentation for more information. A typical configuration object for the pie series could be:
series: [{
        type: 'pie',
        field: 'data1',
        showInLegend: true,
        highlight: {
          segment: {
            margin: 20
          }
        },
        label: {
            field: 'name',
            display: 'rotate',
            contrast: true,
            font: '18px "Lucida Grande"'
        }
    }]
In this configuration we set `pie` as the type for the series, set an object with specific style properties for highlighting options (triggered when hovering elements). We also set true to `showInLegend` so all the pie slices can be represented by a legend item. We set `data1` as the value of the field to determine the angle span for each pie slice. We also set a label configuration object where we set the field name of the store field to be renderer as text for the label. The labels will also be displayed rotated. We set `contrast` to `true` to flip the color of the label if it is to similar to the background color. Finally, we set the font family and size through the `font` parameter.

Config Options

 
The : Number
duration for the pie slice highlight effect.
duration for the pie slice highlight effect.
 
The : String
store record field name to be used for the pie angles. The values bound to this field name must be positive real numb...
store record field name to be used for the pie angles. The values bound to this field name must be positive real numbers. This parameter is required.
 
The : String
store record field name to be used for the pie slice lengths. The values bound to this field name must be positive re...
store record field name to be used for the pie slice lengths. The values bound to this field name must be positive real numbers. This parameter is optional.
 
Whether : Boolean|Number
to set the pie chart as donut chart. Default's false. Can be set to a particular percentage to set the radius of the ...
to set the pie chart as donut chart. Default's false. Can be set to a particular percentage to set the radius of the donut chart.
 
Whether : Boolean
to add the pie chart elements as legend items. Default's false.
to add the pie chart elements as legend items. Default's false.
 
colorSet : Array
An array of color values which will be used, in order, as the pie slice fill colors.
An array of color values which will be used, in order, as the pie slice fill colors.
 
listeners : Object
An (optional) object with event callbacks. All event callbacks get the target *item* as first parameter. The callback...
An (optional) object with event callbacks. All event callbacks get the target *item* as first parameter. The callback functions are:
  • itemmouseover
  • itemmouseout
  • itemmousedown
  • itemmouseup
 
renderer : Function
A function that can be overridden to set custom styling properties to each rendered element. Passes in (sprite, recor...
A function that can be overridden to set custom styling properties to each rendered element. Passes in (sprite, record, attributes, index, store) to the function.
 
An array with shadow attributes
An array with shadow attributes
 
showInLegend : Boolean
Whether to show this series in the legend.
Whether to show this series in the legend.
 
style : Object
An object containing styles for overriding series styles from Theming.
An object containing styles for overriding series styles from Theming.
 
title : String
The human-readable name of the series.
The human-readable name of the series.
 
type : String
The type of series. Set in subclasses.
The type of series. Set in subclasses.

Methods

 
drawSeries : Void
Draws the series for the current chart.
Draws the series for the current chart.
 
getItemForPoint( x {Number}, y {Number} ) : Object
For a given x/y point relative to the Surface, find a corresponding item from this series, if any.
For a given x/y point relative to the Surface, find a corresponding item from this series, if any.

Parameters

  • {Number} : x
    The left pointer coordinate.
  • {Number} : y
    The top pointer coordinate.

Returns

  • Object   An object with the item found or null instead.
 
getLegendColor( item {Object} ) : Void
Returns the color of the series (to be displayed as color for the series legend item).
Returns the color of the series (to be displayed as color for the series legend item).

Parameters

  • {Object} : item
    Info about the item; same format as returned by #getItemForPoint

Returns

  • Void
 
hideAll : Void
Hides all the elements in the series.
Hides all the elements in the series.
 
highlightItem( item {Object} ) : Void
Highlight the specified item. If no item is provided the whole series will be highlighted.
Highlight the specified item. If no item is provided the whole series will be highlighted.

Parameters

  • {Object} : item
    Info about the item; same format as returned by #getItemForPoint

Returns

  • Void
 
showAll : Void
Shows all the elements in the series.
Shows all the elements in the series.
 
unHighlightItem( item {Object} ) : Void
un-highlights the specified item. If no item is provided it will un-highlight the entire series.
un-highlights the specified item. If no item is provided it will un-highlight the entire series.

Parameters

  • {Object} : item
    Info about the item; same format as returned by #getItemForPoint

Returns

  • Void