com.yahoo.astra.fl.charts.axes.CategoryAxis
Keywords: CategoryAxis,com.yahoo.astra.fl.charts.axes.CategoryAxis,calculateCategoryCount,categoryNames,clusterCount,numLabels,getMaxLabel,updateScale,valueToLocal

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

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

An axis type representing a set of categories.

Public Properties
Hide Inherited Public Properties
Show Inherited Public Properties

| Property | Defined by
--- | --- | ---
|  | calculateCategoryCount : Boolean Indicates whether or not to calculate the number of categories (ticks and labels) when there is not enough room to display all labels on the axis. | CategoryAxis
|  | categoryNames : Array The category labels to display along the axis. | CategoryAxis
|  | chart : IChart The chart in which this axis appears. | BaseAxis
|  | clusterCount : int [read-only] The number of clusters available on the axis. | CategoryAxis
|  | dataProvider : Array Data provider for the axis | BaseAxis
|  | height : Number Total height of axis | BaseAxis
|  | 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
|  | 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
|  | numLabels : Number | CategoryAxis
|  | 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
|  | 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
--- | --- | ---
|  | CategoryAxis() Constructor. | CategoryAxis
|  | getMaxLabel():String Returns the maximum string length of a label on the axis. | CategoryAxis
|  | updateScale():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. | BaseAxis
|  | valueToLocal(value:Object):Number Calculates the position of a data point along the axis. | CategoryAxis

Property detail

calculateCategoryCount | property

`calculateCategoryCount:Boolean` [read-write]

Indicates whether or not to calculate the number of categories (ticks and labels) when there is not enough room to display all labels on the axis. If set to true, the axis will determine the number of categories to plot. If not, all categories will be plotted.

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

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`

clusterCount | property |

`clusterCount:int` [read-only]

The number of clusters available on the axis. In the case of the CategoryAxis, this is the number of category names displayed on the axis.

Implementation
`public function get clusterCount():int`

numLabels | property |

`numLabels:Number` [read-write]

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

CategoryAxis | () | constructor

`public function CategoryAxis()`

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

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