Packagecom.yahoo.astra.fl.charts
Classpublic class Axis
InheritanceAxis Inheritance fl.core.UIComponent
ImplementsIAxis
SubclassesCategoryAxis, NumericAxis, TimeAxis

Functionality common to most axes. Generally, an Axis object shouldn't be instantiated directly. Instead, a subclass with a concrete implementation should be used.



Public Properties
 PropertyDefined by
  contentBounds : Rectangle
[read-only] Represents the area where content should be drawn within the axis.
Axis
  labelFunction : Function
A function may be set to determine the text value of the labels.
Axis
  orientation : String
Determines if the axis is displayed vertically or horizontally.
Axis
  overflowEnabled : Boolean
Determines if items such as labels and other visual objects affect the contentBounds property of the axis.
Axis
  plotArea : IPlotArea
The plot area to which this axis is associated.
Axis
  reverse : Boolean
Sets the direction of the labels and other visual objects along the axis.
Axis
  title : String
The text that will appear next to the axis to indicate information about the data that it displays.
Axis
Public Methods
 MethodDefined by
  
Axis(self:Axis)
Constructor.
Axis
  
localToValue(position:Number):Object
Calculates the value of a data point along the axis based on a position.
Axis
  
updateBounds():void
Calculates the contentBounds value for the axis.
Axis
  
updateScale(data:Array):void
Determines the axis scale based on the input data set.
Axis
  
valueToLabel(value:Object):String
Converts a value on the axis to formatted label text.
Axis
  
valueToLocal(value:Object):Number
Calculates the position of a data point along the axis.
Axis
Protected Methods
 MethodDefined by
  
Determines the rectangular bounds where data may be drawn within this axis.
Axis
Property detail
contentBoundsproperty
contentBounds:Rectangle  [read-only]

Represents the area where content should be drawn within the axis. This value is used to determine the containing plot area's own contentBounds property.

Implementation
    public function get contentBounds():Rectangle
labelFunctionproperty 
labelFunction:Function  [read-write]

A function may be set to determine the text value of the labels.

function labelFunction(value:Number):String

Implementation
    public function get labelFunction():Function
    public function set labelFunction(value:Function):void
orientationproperty 
orientation:String  [read-write]

Determines if the axis is displayed vertically or horizontally.

Implementation
    public function get orientation():String
    public function set orientation(value:String):void
overflowEnabledproperty 
overflowEnabled:Boolean  [read-write]

Determines if items such as labels and other visual objects affect the contentBounds property of the axis. If false, these objects may appear outside the chart bounds and overlap other display objects.

Implementation
    public function get overflowEnabled():Boolean
    public function set overflowEnabled(value:Boolean):void
plotAreaproperty 
plotArea:IPlotArea  [read-write]

The plot area to which this axis is associated.

Implementation
    public function get plotArea():IPlotArea
    public function set plotArea(value:IPlotArea):void
reverseproperty 
reverse:Boolean  [read-write]

Sets the direction of the labels and other visual objects along the axis. By default, vertical axes draw objects from bottom to top, and horizontal axes draw objects from left to right.

Implementation
    public function get reverse():Boolean
    public function set reverse(value:Boolean):void
titleproperty 
title:String  [read-write]

The text that will appear next to the axis to indicate information about the data that it displays.

Note: If the axis orientation value is "vertical", the title will only be displayed if the title font is embedded. Implementation
    public function get title():String
    public function set title(value:String):void

Constructor detail
Axis()constructor
public function Axis(self:Axis)

Constructor.

Parameters
self:Axis
Method detail
calculateContentBounds()method
protected function calculateContentBounds():void

Determines the rectangular bounds where data may be drawn within this axis.

localToValue()method 
public function localToValue(position:Number):Object

Calculates the value of a data point along the axis based on a position.

Parameters
position:Number — The position in pixels used to determine the value

Returns
Object — The value on the axis at that position
updateBounds()method 
public function updateBounds():void

Calculates the contentBounds value for the axis. Seperating this function from the draw method optimizes processing time, and it allows the plot area to synchronize its axes.

updateScale()method 
public function updateScale(data:Array):void

Determines the axis scale based on the input data set. Seperating this function from the draw method optimizes processing time, and it allows the plot area to synchronize its axes.

Parameters
data:Array — The complete dataset that could be drawn on the axis.
valueToLabel()method 
public function valueToLabel(value:Object):String

Converts a value on the axis to formatted label text.

Parameters
value:Object — the value of the item for which a label is needed

Returns
String — the formatted label text
valueToLocal()method 
public function valueToLocal(value:Object):Number

Calculates the position of a data point along the axis.

Parameters
value:Object — The data used to determine the position

Returns
Number — The display position in pixels on the axis