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

Package | com.yahoo.astra.fl.charts
Class | public class TimeAxis
Inheritance | TimeAxis Axis fl.core.UIComponent

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

Public Properties
Hide Inherited Public Properties
Show Inherited Public Properties

| Property | Defined by
--- | --- | ---
|  | contentBounds : Rectangle 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
|  | 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
|  | 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
|  | 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
|  | snapToUnits : Boolean If true, the labels, ticks, gridlines, and other objects will snap to the nearest major or minor unit. | TimeAxis
|  | title : String The text that will appear next to the axis to indicate information about the data that it displays. | Axis

Public Methods

| Method | Defined by
--- | --- | ---
|  | TimeAxis() Constructor. | TimeAxis
|  | localToValue(position:Number):Object Calculates the value of a data point along the axis based on a position. | TimeAxis
|  | updateBounds(data:Array):void Determines the axis scale based on the input data set. | TimeAxis
|  | updateScale(data:Array):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

Protected Methods

| Method | Defined by
--- | --- | ---
|  | calculateContentBounds():void Determines the rectangular bounds where data may be drawn within this axis. | TimeAxis
|  | calculateMaximumLabelBounds(proposedMajorUnit:Number):Point | TimeAxis
|  | drawAxis():void Redraws the main axis. | TimeAxis
|  | drawObjectsOnMajorUnit():void Draws labels and ticks at the major unit positions. | TimeAxis
|  | 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. | TimeAxis

Property detail

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`

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

TimeAxis | () | constructor

`public function TimeAxis()`

Constructor.

Method detail

calculateContentBounds | () | method

`protected override function calculateContentBounds():void`

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

calculateMaximumLabelBounds | () | method |

`protected function calculateMaximumLabelBounds(proposedMajorUnit:Number):Point` Parameters

| `proposedMajorUnit:Number`

Returns

| `Point`

drawAxis | () | method |

`protected function drawAxis():void`

Redraws the main axis.

drawObjectsOnMajorUnit | () | method |

`protected function drawObjectsOnMajorUnit():void`

Draws labels and ticks at the major 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.

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