Packageflare.scale
Classpublic class Scale
Implementsmx.core.IMXMLObject
SubclassesOrdinalScale, QuantileScale, QuantitativeScale, ScaleBinding, TimeScale

Base class for all data scale types.



Public Properties
 PropertyDefined by
  flush : Boolean
Flag indicating if the scale bounds should be flush with the data.
Scale
  labelFormat : String
Formatting pattern for formatting labels for scale values.
Scale
  max : Object
The maximum data value backing this scale.
Scale
  min : Object
The minimum data value backing this scale.
Scale
  scaleType : String
[read-only] A string indicating the type of scale this is.
Scale
Protected Properties
 PropertyDefined by
  _flush : Boolean = false
Flag indicating if the scale bounds should be flush with the data.
Scale
  _format : String = "null"
Formatting pattern for formatting labels for scale values.
Scale
Public Methods
 MethodDefined by
  
Returns a cloned copy of the scale.
Scale
  
interpolate(value:Object):Number
Returns an interpolation fraction indicating the position of the input value within the scale range.
Scale
  
label(value:Object):String
Returns a string label representing a value in this scale.
Scale
  
lookup(f:Number):Object
Performs a reverse lookup, returning an object value corresponding to a interpolation fraction along the scale range.
Scale
  
values(num:int = -1):Array
Returns a set of label values for this scale.
Scale
Property detail
_flushproperty
protected var _flush:Boolean = false

Flag indicating if the scale bounds should be flush with the data. False by default, thereby allowing some padding space on the end of the scale.

flushproperty 
flush:Boolean  [read-write]

Flag indicating if the scale bounds should be flush with the data. If true, the scale should be flush with the data range, such that the min and max values should sit directly on the extremes of the scale. If false, the scale should be padded as needed to make the scale more readable and human-friendly.

Implementation
    public function get flush():Boolean
    public function set flush(value:Boolean):void
_formatproperty 
protected var _format:String = "null"

Formatting pattern for formatting labels for scale values.

See also

labelFormatproperty 
labelFormat:String  [read-write]

Formatting pattern for formatting labels for scale values. For details about the various formatting patterns, see the documentation for the Strings.format method.

Implementation
    public function get labelFormat():String
    public function set labelFormat(value:String):void

See also

flare.util.String.format
maxproperty 
max:Object  [read-write]

The maximum data value backing this scale. Note that the actual maximum scale value may be higher if the scale is not flush.

Implementation
    public function get max():Object
    public function set max(value:Object):void
minproperty 
min:Object  [read-write]

The minimum data value backing this scale. Note that the actual minimum scale value may be lower if the scale is not flush.

Implementation
    public function get min():Object
    public function set min(value:Object):void
scaleTypeproperty 
scaleType:String  [read-only]

A string indicating the type of scale this is.

Implementation
    public function get scaleType():String
Method detail
clone()method
public function clone():Scale

Returns a cloned copy of the scale.

Returns
Scale — a cloned scale.
interpolate()method 
public function interpolate(value:Object):Number

Returns an interpolation fraction indicating the position of the input value within the scale range.

Parameters
value:Object — a data value for which to return an interpolation fraction along the data scale

Returns
Number — the interpolation fraction of the value in the data scale
label()method 
public function label(value:Object):String

Returns a string label representing a value in this scale. The labelFormat property determines how the value will be formatted.

Parameters
value:Object — the data value to get the string label for

Returns
String — a string label for the value
lookup()method 
public function lookup(f:Number):Object

Performs a reverse lookup, returning an object value corresponding to a interpolation fraction along the scale range.

Parameters
f:Number — the interpolation fraction

Returns
Object — the scale value at the interpolation fraction. May return null if no value corresponds to the input fraction.
values()method 
public function values(num:int = -1):Array

Returns a set of label values for this scale.

Parameters
num:int (default = -1) — a desired target number of labels. This parameter is handled idiosyncratically by different scale sub-classes.

Returns
Array — an array of label values for the scale