YUI Flash Component Documentation | All Packages | All Classes | Index | Frames No Frames |
Class NumericAxis

Package | com.yahoo.astra.fl.charts.axes
Class | public class NumericAxis
Inheritance | NumericAxis BaseAxis flash.events.EventDispatcher
Implements | IAxis, IOriginAxis, IStackingAxis

An axis type representing a numeric range from minimum to maximum with major and minor divisions.

Public Properties
Hide Inherited Public Properties
Show Inherited Public Properties

| Property | Defined by
--- | --- | ---
|  | adjustMaximumByMajorUnit : Boolean Indicates whether to extend maximum beyond data's maximum to the nearest majorUnit. | NumericAxis
|  | adjustMinimumByMajorUnit : Boolean Indicates whether to extend minimum beyond data's minimum to the nearest majorUnit. | NumericAxis
|  | alwaysShowZero : Boolean If true, the axis will attempt to keep zero visible at all times. | NumericAxis
|  | calculateByLabelSize : Boolean Indicates whether to use the maximum size of an axis label when calculating the majorUnit. | NumericAxis
|  | chart : IChart The chart in which this axis appears. | BaseAxis
|  | dataProvider : Array Data provider for the axis | BaseAxis
|  | height : Number Total height of axis | BaseAxis
|  | idealPixels : Number Desired distance between majorUnits. | NumericAxis
|  | labelData : AxisLabelData Maximum dimensions of axis labels | BaseAxis
|  | labelFunction : Function A function may be set to determine the text value of the labels. | BaseAxis
|  | labelSpacing : Number The space, in pixels, between labels on an axis. | BaseAxis
|  | majorUnit : Number The major unit at which new ticks and labels are drawn. | NumericAxis
|  | maximum : Number The maximum value displayed on the axis. | NumericAxis
|  | maxLabel : String Gets or sets the largest possible label. | BaseAxis
|  | maxLabelHeight : Number Gets or sets the maximum height of a label | BaseAxis
|  | maxLabelWidth : Number Gets or sets the maximum width of a label | BaseAxis
|  | minimum : Number The minimum value displayed on the axis. | NumericAxis
|  | minorUnit : Number The minor unit at which new ticks are drawn. | NumericAxis
|  | numLabels : Number | NumericAxis
|  | order : String = "primary" | BaseAxis
|  | origin : Object [read-only] Returns the value of the origin. | NumericAxis
|  | position : String Position of axis in relation to the chart | BaseAxis
|  | renderer : IAxisRenderer The visual renderer applied to this axis. | BaseAxis
|  | reverse : Boolean Sets the direction of the labels and other visual objects along the axis. | BaseAxis
|  | roundMajorUnit : Boolean Indicates whether to round the major unit | NumericAxis
|  | 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
|  | stackingEnabled : Boolean If true, the axis will allow the stacking of series that implement the interface IStackedSeries. | NumericAxis
|  | title : String The text that will appear next to the axis to indicate information about the data that it displays. | BaseAxis
|  | width : Number Total width of axis | BaseAxis

Public Methods
Hide Inherited Public Methods
Show Inherited Public Methods

| Method | Defined by
--- | --- | ---
|  | NumericAxis() Constructor. | NumericAxis
|  | getMaxLabel():String Returns the maximum string length of a label on the axis. | NumericAxis
|  | stack(top:Object, ... rest):Object Calculates the sum of values if they were stacked on the axis. | NumericAxis
|  | updateScale():void Determines the axis scale based on the input data set. | NumericAxis
|  | valueToLabel(value:Object):String Converts a value on the axis to formatted label text. | BaseAxis
|  | valueToLocal(data:Object):Number Calculates the position of a data point along the axis. | NumericAxis

Property detail

adjustMaximumByMajorUnit | property

`adjustMaximumByMajorUnit:Boolean` [read-write]

Indicates whether to extend maximum beyond data's maximum to the nearest majorUnit.

Implementation
`public function get adjustMaximumByMajorUnit():Boolean`
`public function set adjustMaximumByMajorUnit(value:Boolean):void`

adjustMinimumByMajorUnit | property |

`adjustMinimumByMajorUnit:Boolean` [read-write]

Indicates whether to extend minimum beyond data's minimum to the nearest majorUnit.

Implementation
`public function get adjustMinimumByMajorUnit():Boolean`
`public function set adjustMinimumByMajorUnit(value:Boolean):void`

alwaysShowZero | property |

`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`

calculateByLabelSize | property |

`calculateByLabelSize:Boolean` [read-write]

Indicates whether to use the maximum size of an axis label when calculating the majorUnit.

Implementation
`public function get calculateByLabelSize():Boolean`
`public function set calculateByLabelSize(value:Boolean):void`

idealPixels | property |

`idealPixels:Number` [read-write]

Desired distance between majorUnits. Used to calculate the major unit when unspecified and `calculateByLabelSize` is set to false.

Implementation
`public function get idealPixels():Number`
`public function set idealPixels(value:Number):void`

majorUnit | property |

`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`

maximum | property |

`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`

minimum | property |

`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`

minorUnit | property |

`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`

numLabels | property |

`numLabels:Number` [read-write]

Implementation
`public function get numLabels():Number`
`public function set numLabels(value:Number):void`

origin | property |

`origin:Object` [read-only]

Returns the value of the origin. This is not the position of the origin. To get the origin's position, pass the origin value to valueToLocal(). Note: This value may not be the true origin value. It may be a minimum or maximum value if the actual origin is not visible.

Implementation
`public function get origin():Object`

roundMajorUnit | property |

`roundMajorUnit:Boolean` [read-write]

Indicates whether to round the major unit

Implementation
`public function get roundMajorUnit():Boolean`
`public function set roundMajorUnit(value:Boolean):void`

scale | property |

`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

com.yahoo.astra.fl.charts.ScaleType

snapToUnits | property |

`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`

stackingEnabled | property |

`stackingEnabled:Boolean` [read-write]

If true, the axis will allow the stacking of series that implement the interface IStackedSeries.

Must be explicitly enabled. Implementation
`public function get stackingEnabled():Boolean`
`public function set stackingEnabled(value:Boolean):void`

Constructor detail

NumericAxis | () | constructor

`public function NumericAxis()`

Constructor.

Method detail

getMaxLabel | () | method

`public override function getMaxLabel():String`

Returns the maximum string length of a label on the axis.

Returns

| `String` — the formatted label

stack | () | method |

`public function stack(top:Object, ... rest):Object`

Calculates the sum of values if they were stacked on the axis. The first value is important because some axis types, such as NumericAxis, may differentiate between positive and negative values.

Parameters

| `top:Object`
| `... rest`

Returns

| `Object`

updateScale | () | method |

`public function updateScale():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 chart to synchronize its axes.

valueToLocal | () | method |

`public function valueToLocal(data:Object):Number`

Calculates the position of a data point along the axis.

Parameters

| `data:Object` — The data used to determine the position

Returns

| `Number` — The display position in pixels on the axis