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

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

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

Public Properties
Hide Inherited Public Properties
Show Inherited Public Properties

| Property | Defined by
--- | --- | ---
|  | calculateByLabelSize : Boolean Indicates whether to use the maximum size of an axis label when calculating the majorUnit. | TimeAxis
|  | 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. | TimeAxis
|  | 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
|  | majorTimeUnit : String Combined with majorUnit, determines the amount of time between major ticks and labels. | TimeAxis
|  | majorUnit : Number The major unit at which new lines are drawn. | TimeAxis
|  | maximum : Date The maximum value displayed on the axis. | TimeAxis
|  | 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 : Date The minimum value displayed on the axis. | TimeAxis
|  | minorTimeUnit : String Combined with minorUnit, determines the amount of time between minor ticks. | TimeAxis
|  | minorUnit : Number The minor unit at which new lines are drawn. | TimeAxis
|  | order : String = "primary" | BaseAxis
|  | 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
|  | snapToUnits : Boolean If true, the labels, ticks, gridlines, and other objects will snap to the nearest major or minor unit. | TimeAxis
|  | stackingEnabled : Boolean If true, the axis will allow the stacking of series that implement the interface IStackedSeries. | TimeAxis
|  | 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

Protected Properties

| Property | Defined by
--- | --- | ---
|  | positionMultiplier : Number = 0 | TimeAxis

Public Methods

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

Property detail

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`

majorTimeUnit | property |

`majorTimeUnit:String` [read-write]

Combined with majorUnit, determines the amount of time between major ticks and labels.

Implementation
`public function get majorTimeUnit():String`
`public function set majorTimeUnit(value:String):void`

See also

com.yahoo.astra.fl.charts.TimeUnit;

majorUnit | property |

`majorUnit:Number` [read-write]

The major unit at which new lines are drawn.

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

maximum | property |

`maximum:Date` [read-write]

The maximum value displayed on the axis.

Implementation
`public function get maximum():Date`
`public function set maximum(value:Date):void`

minimum | property |

`minimum:Date` [read-write]

The minimum value displayed on the axis.

Implementation
`public function get minimum():Date`
`public function set minimum(value:Date):void`

minorTimeUnit | property |

`minorTimeUnit:String` [read-write]

Combined with minorUnit, determines the amount of time between minor ticks.

Implementation
`public function get minorTimeUnit():String`
`public function set minorTimeUnit(value:String):void`

See also

com.yahoo.astra.fl.charts.TimeUnit;

minorUnit | property |

`minorUnit:Number` [read-write]

The minor unit at which new lines are drawn.

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

positionMultiplier | property |

`protected var positionMultiplier:Number = 0`

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

TimeAxis | () | constructor

`public function TimeAxis()`

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.

valueToLabel | () | method |

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