Packagecom.yahoo.astra.fl.charts
Classpublic class NumericAxis
InheritanceNumericAxis Inheritance Axis Inheritance fl.core.UIComponent

An axis type representing a numeric range. Labels appear on major units. Ticks and grid lines may optionally appear on major and minor units.



Public Properties
 PropertyDefined by
  alwaysShowZero : Boolean
If true, the axis will attempt to keep zero visible at all times.
NumericAxis
 InheritedcontentBounds : Rectangle
Represents the area where content should be drawn within the axis.
Axis
 InheritedlabelFunction : Function
A function may be set to determine the text value of the labels.
Axis
  majorUnit : Number
The major unit at which new ticks and labels are drawn.
NumericAxis
  maximum : Number
The maximum value displayed on the axis.
NumericAxis
  minimum : Number
The minimum value displayed on the axis.
NumericAxis
  minorUnit : Number
The minor unit at which new ticks are drawn.
NumericAxis
 Inheritedorientation : String
Determines if the axis is displayed vertically or horizontally.
Axis
  origin : Number
[read-only] The value of the origin.
NumericAxis
 InheritedoverflowEnabled : Boolean
Determines if items such as labels and other visual objects affect the contentBounds property of the axis.
Axis
 InheritedplotArea : IPlotArea
The plot area to which this axis is associated.
Axis
 Inheritedreverse : Boolean
Sets the direction of the labels and other visual objects along the axis.
Axis
  scale : String
The type of scaling used to display items on the axis.
NumericAxis
  snapToUnits : Boolean
If true, the labels, ticks, gridlines, and other objects will snap to the nearest major or minor unit.
NumericAxis
 Inheritedtitle : String
The text that will appear next to the axis to indicate information about the data that it displays.
Axis
Public Methods
 MethodDefined by
  
Constructor.
NumericAxis
  
localToValue(position:Number):Object
Calculates the value of a data point along the axis based on a position.
NumericAxis
  
updateBounds(data:Array):void
Determines the axis scale based on the input data set.
NumericAxis
  
updateScale(data:Array):void
Determines the axis scale based on the input data set.
NumericAxis
 Inherited
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.
NumericAxis
Protected Methods
 MethodDefined by
  
Determines the rectangular bounds where data may be drawn within this axis.
NumericAxis
  
drawAxis():void
Draws the axis origin line.
NumericAxis
  
Draws labels, grid lines, and ticks at the major unit positions.
NumericAxis
  
Draws grid lines and ticks at the minor unit positions.
NumericAxis
  
resetScale():void
If the minimum, maximum, major unit or minor unit have not been set by the user, these values must be generated by the axis.
NumericAxis
Property detail
alwaysShowZeroproperty
alwaysShowZero:Boolean  [read-write]

If true, the axis will attempt to keep zero visible at all times. If both the minimum and maximum values displayed on the axis are above zero, the minimum will be reset to zero. If both minimum and maximum appear below zero, the maximum will be reset to zero. If the minimum and maximum appear at positive and negative values respectively, zero is already visible and the axis scale does not change.

This property has no affect if you manually set the minimum and maximum values of the axis.

Implementation
    public function get alwaysShowZero():Boolean
    public function set alwaysShowZero(value:Boolean):void
majorUnitproperty 
majorUnit:Number  [read-write]

The major unit at which new ticks and labels are drawn. By default, this value is generated by the axis itself. If the user defines this value, the axis will skip the automatic generation. To enable this behavior again, set this property to NaN.

Implementation
    public function get majorUnit():Number
    public function set majorUnit(value:Number):void
maximumproperty 
maximum:Number  [read-write]

The maximum value displayed on the axis. By default, this value is generated by the axis itself. If the user defines this value, the axis will skip this automatic generation. To enable this behavior again, set this property to NaN.

Implementation
    public function get maximum():Number
    public function set maximum(value:Number):void
minimumproperty 
minimum:Number  [read-write]

The minimum value displayed on the axis. By default, this value is generated by the axis itself. If the user defines this value, the axis will skip this automatic generation. To enable this behavior again, set this property to NaN.

Implementation
    public function get minimum():Number
    public function set minimum(value:Number):void
minorUnitproperty 
minorUnit:Number  [read-write]

The minor unit at which new ticks are drawn. By default, this value is generated by the axis itself. If the user defines this value, the axis will skip the automatic generation. To enable this behavior again, set this property to NaN.

Implementation
    public function get minorUnit():Number
    public function set minorUnit(value:Number):void
originproperty 
origin:Number  [read-only]

The value of the origin. Depends on the scale type. Note: This value may not be the "true" origin value. It may be the minimum or maximum value if the "true" origin is not visible.

Implementation
    public function get origin():Number
scaleproperty 
scale:String  [read-write]

The type of scaling used to display items on the axis.

Implementation
    public function get scale():String
    public function set scale(value:String):void

See also

snapToUnitsproperty 
snapToUnits:Boolean  [read-write]

If true, the labels, ticks, gridlines, and other objects will snap to the nearest major or minor unit. If false, their position will be based on the minimum value.

Implementation
    public function get snapToUnits():Boolean
    public function set snapToUnits(value:Boolean):void
Constructor detail
NumericAxis()constructor
public function NumericAxis()

Constructor.

Method detail
calculateContentBounds()method
protected override function calculateContentBounds():void

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

drawAxis()method 
protected function drawAxis():void

Draws the axis origin line.

drawObjectsOnMajorUnit()method 
protected function drawObjectsOnMajorUnit():void

Draws labels, grid lines, and ticks at the major unit positions.

drawObjectsOnMinorUnit()method 
protected function drawObjectsOnMinorUnit():void

Draws grid lines and ticks at the minor unit positions.

localToValue()method 
public override 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
resetScale()method 
protected function resetScale():void

If the minimum, maximum, major unit or minor unit have not been set by the user, these values must be generated by the axis. May be overridden to use custom scaling algorithms.

updateBounds()method 
public override function updateBounds(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.
updateScale()method 
public override 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.
valueToLocal()method 
public override 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