YUI AS Component Documentation |
Class AxisLabelUtil

Package | com.yahoo.astra.utils
Class | public class AxisLabelUtil

Used to measure dimensions for BitmapText objects.

Public Methods

| Method | Defined by
--- | --- | ---
|  | getBitmapTextSize(textField:TextField, rotation:Number):Object [static] Returns the dimensions of a text field if rotated. | AxisLabelUtil
|  | getTextHeight(textValue:String, tf:TextFormat, rotation:Number = 0):Number [static] Returns the potential height of a string when rendered in a text field. | AxisLabelUtil
|  | getTextWidth(textValue:String, tf:TextFormat, rotation:Number = 0):Number [static] Returns the potential width of a string when rendered in a text field. | AxisLabelUtil

Method detail

getBitmapTextSize | () | method

`public static function getBitmapTextSize(textField:TextField, rotation:Number):Object`

Returns the dimensions of a text field if rotated.

Parameters

| `textField:TextField` — The text field to be used
| `rotation:Number` — The rotation to be applied

Returns

| `Object`

getTextHeight | () | method |

`public static function getTextHeight(textValue:String, tf:TextFormat, rotation:Number = 0):Number`

Returns the potential height of a string when rendered in a text field. Takes into account the `TextFormat` settings and the rotation.

Parameters

| `textValue:String` — The string that will be used.
| `tf:TextFormat` — The TextFormat object that will be applied.
| `rotation:Number` (default = `0`)`` — The rotation that will be applied

Returns

| `Number`

getTextWidth | () | method |

`public static function getTextWidth(textValue:String, tf:TextFormat, rotation:Number = 0):Number`

Returns the potential width of a string when rendered in a text field. Takes into account the `TextFormat` settings and the rotation.

Parameters

| `textValue:String` — The string that will be used.
| `tf:TextFormat` — The TextFormat object that will be applied.
| `rotation:Number` (default = `0`)`` — The rotation that will be applied

Returns

| `Number`