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

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

An axis type representing a range of categories.

Public Properties
Hide Inherited Public Properties
Show Inherited Public Properties

| Property | Defined by
--- | --- | ---
|  | categoryNames : Array The category labels to display along the axis. | CategoryAxis
|  | 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
|  | 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

| Method | Defined by
--- | --- | ---
|  | CategoryAxis() Constructor. | CategoryAxis
|  | localToValue(position:Number):Object Calculates the value of a data point along the axis based on a position. | CategoryAxis
|  | updateBounds():void Calculates the `contentBounds` value for the axis. | CategoryAxis
|  | updateScale(data:Array):void Determines the axis scale based on the input data set. | CategoryAxis
|  | valueToLabel(value:Object):String Converts a value on the axis to formatted label text. | CategoryAxis
|  | valueToLocal(value:Object):Number Calculates the position of a data point along the axis. | CategoryAxis

Protected Methods

| Method | Defined by
--- | --- | ---
|  | calculateContentBounds():void Determines the rectangular bounds where data may be drawn within this axis. | CategoryAxis
|  | drawAxis():void Draws the axis origin line. | CategoryAxis
|  | drawObjects():void Draws the labels, ticks, and gridlines of the axis. | CategoryAxis

Property detail

categoryNames | property

`categoryNames:Array` [read-write]

The category labels to display along the axis.

Implementation
`public function get categoryNames():Array`
`public function set categoryNames(value:Array):void`
Constructor detail

CategoryAxis | () | constructor

`public function CategoryAxis()`

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.

drawObjects | () | method |

`protected function drawObjects():void`

Draws the labels, ticks, and gridlines of the axis.

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

updateBounds | () | method |

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