Packageardisia.components.gauges
Classpublic class GaugeBase
InheritanceGaugeBase Inheritance spark.components.supportClasses.SliderBase
Subclasses LinearGaugeBase, RadialGauge

Base class for both the linear and radial gauges.



Public Properties
 PropertyDefined By
  editable : Boolean
Whether the value can be changed via user interaction.
GaugeBase
  labelDefaultPrecision : Number
Default precision for the number formatter if a labelsFormatFunction is not provided.
GaugeBase
  labelsFormatFunction : Function
The callback function used to format the labels.
GaugeBase
  majorTickCount : int
The number of major ticks to display.
GaugeBase
  minorTickCount : int
The number of minor ticks to display between major ticks.
GaugeBase
  showTickLabels : Boolean
True to display labels along with the major ticks.
GaugeBase
  showTicks : Boolean
True to display ticks.
GaugeBase
Public Methods
 MethodDefined By
  
dispose():void
Remove the component from the display list and prepare the component for garbage collection.
GaugeBase
Protected Methods
 MethodDefined By
  
formatLabelText(value:Number):Object
Format the value to a human readable String.
GaugeBase
  
Update the tick labels skin parts.
GaugeBase
Styles
 Style Description Defined By
  
labelOffset
Type: Number CSS Inheritance: no
The number of pixels to offset the labels from the tick marks. The default value is 3.
GaugeBase
  
majorTickColor
Type: uint Format: Color CSS Inheritance: no
The color of the major ticks. The default value is #000000.
GaugeBase
  
majorTickForm
Type: String CSS Inheritance: no
The shape of the major tick mark: line or circle. The default value is "line".
GaugeBase
  
majorTickLength
Type: Number CSS Inheritance: no
The length of the major tick. For a line would be the length, irrelevant for a circle. Thickness controls the radius of a circle form. The default value is 10.
GaugeBase
  
majorTickThickness
Type: Number CSS Inheritance: no
The thickness of major tick strokes or the radius of the circle. The default value is 1.
GaugeBase
  
minorTickColor
Type: uint Format: Color CSS Inheritance: no
The color of the minor ticks. The default value is #999999.
GaugeBase
  
minorTickForm
Type: String CSS Inheritance: no
The shape of the minor tick mark: line or circle. The default value is "line".
GaugeBase
  
minorTickLength
Type: Number CSS Inheritance: no
The length of the minor tick. For a line would be the length, irrelevant for a circle. Thickness controls the radius of a circle form. The default value is 5.
GaugeBase
  
minorTickThickness
Type: Number CSS Inheritance: no
The thickness of minor tick strokes or the radius of the circle. The default value is 1.
GaugeBase
  
tickOffset
Type: Number CSS Inheritance: no
The number of pixels to offset the tick marks from the track. The default value is 3.
GaugeBase
Skin Parts

This component uses skins made up of skin parts. Do not set the skin parts directly. The component's skin sets the skin parts.


 Skin Part Description Defined By
  
labelsFactoryPart:mx.core.IFactory
Required: false Part Type: Dynamic
Factory that creates the labels that are displayed along with the major ticks. Used by both the linear and radial gauges.

The IFactory must return an object of type Label
GaugeBase
Skin States

To skin the component, implement a skin that defines the following states. Although you must implement all skin states, a skin state can be empty. An empty skin state specifies no changes to the default skin state.


 Skin State Description Defined By
  
notEditable
State used when the control is disabled, but the component should not be displayed as disabled. Useful to statically present information via a slider. For example: a thermometer to show fundraising totals. GaugeBase
Property Detail
editableproperty
editable:Boolean

Whether the value can be changed via user interaction.

If false, can be used to statically display information without disabling the control.

The default value is true.


Implementation
    public function get editable():Boolean
    public function set editable(value:Boolean):void
labelDefaultPrecisionproperty 
labelDefaultPrecision:Number

Default precision for the number formatter if a labelsFormatFunction is not provided.

The default value is 2.


Implementation
    public function get labelDefaultPrecision():Number
    public function set labelDefaultPrecision(value:Number):void
labelsFormatFunctionproperty 
labelsFormatFunction:Function

The callback function used to format the labels. Use this property to parse numerical values into strings if desired.

For example, if the labels should read "red", "blue", and "red", create a callback function that parses the numerical values into these color strings.

The default value is null.


Implementation
    public function get labelsFormatFunction():Function
    public function set labelsFormatFunction(value:Function):void
majorTickCountproperty 
majorTickCount:int

The number of major ticks to display. Minimum of 2.

To not display major ticks, set the "showTicks" property to false.

The default value is 6.


Implementation
    public function get majorTickCount():int
    public function set majorTickCount(value:int):void
minorTickCountproperty 
minorTickCount:int

The number of minor ticks to display between major ticks.

Set to 0 to not display any minor tick marks. Also, if "showTicks" is set to false then no minor ticks will be displayed.

The default value is 1.


Implementation
    public function get minorTickCount():int
    public function set minorTickCount(value:int):void
showTickLabelsproperty 
showTickLabels:Boolean

True to display labels along with the major ticks.

The default value is true.


Implementation
    public function get showTickLabels():Boolean
    public function set showTickLabels(value:Boolean):void
showTicksproperty 
showTicks:Boolean

True to display ticks.

The default value is true.


Implementation
    public function get showTicks():Boolean
    public function set showTicks(value:Boolean):void
Method Detail
dispose()method
public function dispose():void

Remove the component from the display list and prepare the component for garbage collection.

formatLabelText()method 
protected function formatLabelText(value:Number):Object

Format the value to a human readable String.

Will use the labelsFormatFunction if provided. Otherwise, will default to a Spark NumberFormatter.

Parameters

value:Number — the Number to parse to a string

Returns
Object — a parsed Object
updateTickLabels()method 
protected function updateTickLabels():void

Update the tick labels skin parts.