A chart component for graphing an array of numeric data as a pie chart.

Note: the data parameter of the PieChart, like the other charts, is an array. It can be a simple array of Numbers where each number represents one slice of the pie. It can also be an array of objects. If objects are used, each object represents one slice of the pie and can contain three properties: - value: The numeric value to chart. - label: The label to display next to the slice. - color: The color to make the slice.

Constructor

new (?parent:DisplayObjectContainer, ?xpos:Float, ?ypos:Float, ?data:Array<Float>)

Constructor

Parameters:

parent

The parent DisplayObjectContainer on which to add this Label.

xpos

The x position to place this component.

ypos

The y position to place this component.

data

The array of numeric values or objects to graph.

Variables

beginningAngle:Float

Sets/gets the angle at which to start the first slice.

colors:Array<UInt>

Sets/gets the default array of colors to use for each arc.

Methods

get_colors ():Array<UInt>

set_beginningAngle (value:Float):Float

set_colors (value:Array<UInt>):Array<UInt>

Inherited Variables

Defined by Chart

autoScale:Bool

Sets/gets whether the graph will automatically set its own max and min values based on the data values.

data:Array<Dynamic>

Sets/gets the data array.

gridColor:UInt

Sets / gets the color of the grid lines.

gridSize:Int

Sets / gets the size of the grid.

labelPrecision:Int

Sets/gets the amount of decimal places shown in the scale labels.

maximum:Float

Sets/gets the maximum value of the graph. Only used if autoScale is false.

minimum:Float

Sets/gets the minimum value of the graph. Only used if autoScale is false.

showGrid:Bool

Sets / gets whether or not the grid will be shown.

showScaleLabels:Bool

Sets/gets whether or not labels for max and min graph values will be shown. Note: these labels will be to the left of the x position of the chart. Chart position may need adjusting.

Defined by Component

enabled:Bool

Sets/gets whether this component is enabled or not.

tag:Int

Sets/gets in integer that can identify the component.

Inherited Methods

Defined by Chart

draw ():Void

Draws the visual ui of the component.

get_data ():Array<Dynamic>

get_maximum ():Float

get_minimum ():Float

get_showGrid ():Bool

set_autoScale (value:Bool):Bool

set_data (value:Array<Dynamic>):Array<Dynamic>

set_gridColor (value:UInt):UInt

set_gridSize (value:Int):Int

set_labelPrecision (value:Int):Int

set_maximum (value:Float):Float

set_minimum (value:Float):Float

set_showGrid (value:Bool):Bool

set_showScaleLabels (value:Bool):Bool

Defined by Component

get_enabled ():Bool

get_height ():Float

get_tag ():Int

get_width ():Float

move (xpos:Float, ypos:Float):Void

Moves the component to the specified position.

Parameters:

xpos

the x position to move the component

ypos

the y position to move the component

setSize (w:Float, h:Float):Void

Sets the size of the component.

Parameters:

w

The width of the component.

h

The height of the component.

set_enabled (value:Bool):Bool

set_height (value:Float):Void

Sets/gets the height of the component.

set_tag (value:Int):Int

set_width (value:Float):Void

Sets/gets the width of the component.

set_x (value:Float):Void

Overrides the setter for x to always place the component on a whole pixel.

set_y (value:Float):Void

Overrides the setter for y to always place the component on a whole pixel.