Package com.bit101.charts
Class public class Chart
Inheritance Chart InheritanceComponent Inheritance flash.display.Sprite
Subclasses BarChart, LineChart, PieChart



Public Properties
  Property Defined By
    autoScale : Boolean
Sets/gets whether the graph will automatically set its own max and min values based on the data values.
Chart
    data : Array
Sets/gets the data array.
Chart
  Inherited enabled : Boolean
Sets/gets whether this component is enabled or not.
Component
    gridColor : uint
Sets / gets the color of the grid lines.
Chart
    gridSize : int
Sets / gets the size of the grid.
Chart
  Inherited height : Number
[override] Sets/gets the height of the component.
Component
    labelPrecision : int
Sets/gets the amount of decimal places shown in the scale labels.
Chart
    maximum : Number
Sets/gets the maximum value of the graph.
Chart
    minimum : Number
Sets/gets the minimum value of the graph.
Chart
    showGrid : Boolean
Sets / gets whether or not the grid will be shown.
Chart
    showScaleLabels : Boolean
Sets/gets whether or not labels for max and min graph values will be shown.
Chart
  Inherited tag : int
Sets/gets in integer that can identify the component.
Component
  Inherited width : Number
[override] Sets/gets the width of the component.
Component
  Inherited x : Number
[override] [write-only] Overrides the setter for x to always place the component on a whole pixel.
Component
  Inherited y : Number
[override] [write-only] Overrides the setter for y to always place the component on a whole pixel.
Component
Protected Properties
  Property Defined By
    _autoScale : Boolean = true
Chart
    _chartHolder : Shape
Chart
    _data : Array
Chart
  Inherited _enabled : Boolean = true
Component
  Inherited _height : Number = 0
Component
    _labelPrecision : int = 0
Chart
    _maximum : Number = 100
Chart
    _maxLabel : Label
Chart
    _minimum : Number = 0
Chart
    _minLabel : Label
Chart
    _panel : Panel
Chart
  Inherited Ronda : Class
Component
    _showScaleLabels : Boolean = false
Chart
  Inherited _tag : int = -1
Component
  Inherited _width : Number = 0
Component
Public Methods
  Method Defined By
   
Chart(parent:DisplayObjectContainer = null, xpos:Number = 0, ypos:Number = 0, data:Array = null)
Constructor
Chart
   
draw():void
[override] Draws the visual ui of the component.
Chart
  Inherited
initStage(stage:Stage):void
[static] Utility method to set up usual stage align and scaling.
Component
  Inherited
move(xpos:Number, ypos:Number):void
Moves the component to the specified position.
Component
  Inherited
setSize(w:Number, h:Number):void
Sets the size of the component.
Component
Protected Methods
  Method Defined By
   
addChildren():void
[override] Creates and adds the child display objects of this component.
Chart
   
drawChart():void
Graphs the numeric data in the chart.
Chart
   
getMaxValue():Number
Gets the highest value of the numbers in the data array.
Chart
   
getMinValue():Number
Gets the lowest value of the numbers in the data array.
Chart
  Inherited
getShadow(dist:Number, knockout:Boolean = false):DropShadowFilter
DropShadowFilter factory method, used in many of the components.
Component
   
init():void
[override] Initializes the component.
Chart
  Inherited
invalidate():void
Marks the component to be redrawn on the next frame.
Component
  Inherited
onInvalidate(event:Event):void
Called one frame after invalidate is called.
Component
Public Constants
  Constant Defined By
  Inherited DRAW : String = draw
[static]
Component
Property Detail
_autoScale property
protected var _autoScale:Boolean = true

_chartHolder property  
protected var _chartHolder:Shape

_data property  
protected var _data:Array

_labelPrecision property  
protected var _labelPrecision:int = 0

_maximum property  
protected var _maximum:Number = 100

_maxLabel property  
protected var _maxLabel:Label

_minimum property  
protected var _minimum:Number = 0

_minLabel property  
protected var _minLabel:Label

_panel property  
protected var _panel:Panel

_showScaleLabels property  
protected var _showScaleLabels:Boolean = false

autoScale property  
autoScale:Boolean

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


Implementation
    public function get autoScale():Boolean
    public function set autoScale(value:Boolean):void
data property  
data:Array

Sets/gets the data array.


Implementation
    public function get data():Array
    public function set data(value:Array):void
gridColor property  
gridColor:uint

Sets / gets the color of the grid lines.


Implementation
    public function get gridColor():uint
    public function set gridColor(value:uint):void
gridSize property  
gridSize:int

Sets / gets the size of the grid.


Implementation
    public function get gridSize():int
    public function set gridSize(value:int):void
labelPrecision property  
labelPrecision:int

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


Implementation
    public function get labelPrecision():int
    public function set labelPrecision(value:int):void
maximum property  
maximum:Number

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


Implementation
    public function get maximum():Number
    public function set maximum(value:Number):void
minimum property  
minimum:Number

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


Implementation
    public function get minimum():Number
    public function set minimum(value:Number):void
showGrid property  
showGrid:Boolean

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


Implementation
    public function get showGrid():Boolean
    public function set showGrid(value:Boolean):void
showScaleLabels property  
showScaleLabels:Boolean

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.


Implementation
    public function get showScaleLabels():Boolean
    public function set showScaleLabels(value:Boolean):void
Constructor Detail
Chart () Constructor
public function Chart(parent:DisplayObjectContainer = null, xpos:Number = 0, ypos:Number = 0, data:Array = null)

Constructor

Parameters
parent:DisplayObjectContainer (default = null) — The parent DisplayObjectContainer on which to add this Label.
 
xpos:Number (default = 0) — The x position to place this component.
 
ypos:Number (default = 0) — The y position to place this component.
 
data:Array (default = null) — The array of numeric values to graph.
Method Detail
addChildren () method
override protected function addChildren():void

Creates and adds the child display objects of this component.

draw () method  
override public function draw():void

Draws the visual ui of the component.

drawChart () method  
protected function drawChart():void

Graphs the numeric data in the chart. Override in subclasses.

getMaxValue () method  
protected function getMaxValue():Number

Gets the highest value of the numbers in the data array.

Returns
Number
getMinValue () method  
protected function getMinValue():Number

Gets the lowest value of the numbers in the data array.

Returns
Number
init () method  
override protected function init():void

Initializes the component.