Packageardisia.charts.donut
Classpublic class Donut
InheritanceDonut Inheritance ChartBase Inheritance spark.components.supportClasses.SkinnableComponent

Donut chart class. Capable of displaying multiple rings of data.

View the technical documentation on the Ardisia Labs website for more information.

Default MXML PropertydataProvider



Public Properties
 PropertyDefined By
  angleOffset : Number
Angle at which to begin drawing the rings.
Donut
  categories : Vector.<DonutCategory>
A vector of the field(s) on the data that defines the category value(s).
Donut
 InheritedcolorField : String
Field name on the data to pull the node's color.
ChartBase
 InheritedcolorFormatFunction : Function
User provided function that returns the color for the series when passed the series data object.
ChartBase
 InheriteddataProvider : ListCollectionView
The dataProvider for the chart.
ChartBase
 InheriteddataTipField : String
Field name on the data to pull the node's data tip string.
ChartBase
 InheriteddataTipFormatFunction : Function
User provided function that gets the message to display with the data tip.
ChartBase
 InheriteddataTipHideDelay : Number = 350
Delay before the data tip is hidden.
ChartBase
 InheriteddataTipInstance : IDataRenderer
Instance of the data tip.
ChartBase
 InheritedexcludedSeries : Array
Array of the series that should not be displayed.
ChartBase
 InheritedhighlightAlpha : Number = 0.4
When series data is highlighted, the alpha to apply.
ChartBase
 InheritedhighlightDuration : Number = 250
Duration of the highlight effects.
ChartBase
  _hoveredCategoryIndex : int
Donut
  hoveredCategoryIndex : int
[read-only] Category index of a renderer that is currently hovered.
Donut
  innerRadius : Number
The inner radius before drawing the rings.
Donut
  ringSeparation : Number
Separation in pixels between different rings.
Donut
  seriesField : String
The field on the data that defines the series value.
Donut
  seriesLabelOffset : Number
The number of pixels to offset the axis labels radially from the ends of the category axes.
Donut
 InheritedshowDataTip : Boolean = true
True to display a data tip on hover.
ChartBase
  showPercentages : Boolean
Display the percentage of each slice in a label.
Donut
  showSeriesLabels : Boolean
Display the labels for the series.
Donut
  wedgeSeperation : Number
Separation in pixels between different wedges.
Donut
Protected Properties
 PropertyDefined By
 InheritednumberFormatter : NumberFormatter
Default number formatter.
ChartBase
  wedgeRenderers : Vector.<DonutRenderer>
Vector of renderers for the wedges.
Donut
Public Methods
 MethodDefined By
  
getColor(item:Object):uint
Returns the color for each series.
Donut
 Inherited
Hide the data tip.
ChartBase
  
setHighlightedSeries(item:Object):void
[override] Highlight the passed series.
Donut
Protected Methods
 MethodDefined By
  
eventHandler(event:Event):void
[override] Handles the events for the class.
Donut
  
formatPercentLabelsText(value:Number):String
Return formatted string to display for the percentage labels.
Donut
  
getDataTipContent(data:Object):Object
[override] Returns the contents for the data tip.
Donut
 Inherited
setupDataTip(data:Object):void
Setup the data tip.
ChartBase
 Inherited
updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
[override]
ChartBase
Events
 Event Summary Defined By
 InheritedDispatched when the chart's legend should be updated.ChartBase
Skin Parts

This component uses skins made up of skin parts. Do not set the skin parts directly. The component's skin sets the skin parts.


 Skin Part Description Defined By
 Inherited
dataTipFactoryPart:mx.core.IFactory
Required: false Part Type: Dynamic
Displays the data tip when a node is hovered.

The IFactory must return an object of type IDataRenderer
ChartBase
  
percentagesLabelFactoryPart:mx.core.IFactory
Required: false Part Type: Dynamic
Creates and displays the percentage for each wedge.

The IFactory must return an object of type Label
Donut
  
seriesLabelFactoryPart:mx.core.IFactory
Required: false Part Type: Dynamic
Creates and displays the labels for the series.

The IFactory must return an object of type Label
Donut
 InheritedRequired: false Part Type: Dynamic
Container for the content added to the skin.
ChartBase
Skin States

To skin the component, implement a skin that defines the following states. Although you must implement all skin states, a skin state can be empty. An empty skin state specifies no changes to the default skin state.


 Skin State Description Defined By
 InheritedChartBase
 InheritedChartBase
Property Detail
_hoveredCategoryIndexproperty
public var _hoveredCategoryIndex:int

angleOffsetproperty 
angleOffset:Number

Angle at which to begin drawing the rings.

The default value is 0.


Implementation
    public function get angleOffset():Number
    public function set angleOffset(value:Number):void
categoriesproperty 
categories:Vector.<DonutCategory>

A vector of the field(s) on the data that defines the category value(s).

The default value is null.


Implementation
    public function get categories():Vector.<DonutCategory>
    public function set categories(value:Vector.<DonutCategory>):void
hoveredCategoryIndexproperty 
hoveredCategoryIndex:int  [read-only]

Category index of a renderer that is currently hovered.

Useful to style the dataTip.

The default value is -1.


Implementation
    public function get hoveredCategoryIndex():int
innerRadiusproperty 
innerRadius:Number

The inner radius before drawing the rings.

The default value is 20.


Implementation
    public function get innerRadius():Number
    public function set innerRadius(value:Number):void
ringSeparationproperty 
ringSeparation:Number

Separation in pixels between different rings. Only applicable if multiple categoryFields are defined.

The default value is 4.


Implementation
    public function get ringSeparation():Number
    public function set ringSeparation(value:Number):void
seriesFieldproperty 
seriesField:String

The field on the data that defines the series value.

The default value is "".


Implementation
    public function get seriesField():String
    public function set seriesField(value:String):void
seriesLabelOffsetproperty 
seriesLabelOffset:Number

The number of pixels to offset the axis labels radially from the ends of the category axes.

The default value is 5.


Implementation
    public function get seriesLabelOffset():Number
    public function set seriesLabelOffset(value:Number):void
showPercentagesproperty 
showPercentages:Boolean

Display the percentage of each slice in a label.

The default value is false.


Implementation
    public function get showPercentages():Boolean
    public function set showPercentages(value:Boolean):void
showSeriesLabelsproperty 
showSeriesLabels:Boolean

Display the labels for the series.

The default value is true.


Implementation
    public function get showSeriesLabels():Boolean
    public function set showSeriesLabels(value:Boolean):void
wedgeRenderersproperty 
protected var wedgeRenderers:Vector.<DonutRenderer>

Vector of renderers for the wedges.

wedgeSeperationproperty 
wedgeSeperation:Number

Separation in pixels between different wedges.

The default value is 2.


Implementation
    public function get wedgeSeperation():Number
    public function set wedgeSeperation(value:Number):void
Method Detail
eventHandler()method
override protected function eventHandler(event:Event):void

Handles the events for the class.

Parameters

event:Event — the Event that triggered the handler

formatPercentLabelsText()method 
protected function formatPercentLabelsText(value:Number):String

Return formatted string to display for the percentage labels.

Parameters

value:Number — the Number to format

Returns
String — a formatted String
getColor()method 
public function getColor(item:Object):uint

Returns the color for each series. First applies the color via the colorFormatFunction, next uses an optional colorField, and finally uses a default coloring scheme.

The function has the following signature:

	  funcName(index:int):uint
	  

Parameters

item:Object

Returns
uint
getDataTipContent()method 
override protected function getDataTipContent(data:Object):Object

Returns the contents for the data tip. Uses the "dataTipField" first, then the "dataTipFormatFunction" function, then the class default.

Can return a TextFlow or a String.

Parameters

data:Object — Object

Returns
Object — Object
setHighlightedSeries()method 
override public function setHighlightedSeries(item:Object):void

Highlight the passed series.

Pass a null value to remove any applied effects.

Parameters

item:Object — Object