| Package | flare.scale |
| Class | public class TimeScale |
| Inheritance | TimeScale Scale |
Date values. This
scale represents a linear, quantitative time line. The class attempts
to automatically configure date value labels based on the time span
between the earliest and latest date in the scale. The label formatting
pattern can also be manually set using the labelFormat
property.
| Property | Defined by | ||
|---|---|---|---|
| dataMax : Date The maximum (latest) Date value in the underlying data.
| TimeScale | ||
| dataMin : Date The minimum (earliest) Date value in the underlying data.
| TimeScale | ||
| flush : Boolean [write-only]
| TimeScale | ||
| labelFormat : String
Formatting pattern for formatting labels for scale values.
| TimeScale | ||
| max : Object The maximum data value backing this scale.
| TimeScale | ||
| min : Object The minimum data value backing this scale.
| TimeScale | ||
| scaleMax : Date [read-only] The maximum (latest) Date value in the underlying data.
| TimeScale | ||
| scaleMin : Date [read-only] The minimum (earliest) Date value in the scale.
| TimeScale | ||
| scaleType : String [read-only] A string indicating the type of scale this is.
| TimeScale | ||
| Method | Defined by | ||
|---|---|---|---|
|
TimeScale(min:Date = null, max:Date = null, flush:Boolean = false, labelFormat:String = null)
Creates a new TimeScale.
| TimeScale | ||
|
Returns a cloned copy of the scale.
| TimeScale | ||
|
interpolate(value:Object):Number
Returns an interpolation fraction indicating the position of the input
value within the scale range.
| TimeScale | ||
![]() |
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.
| TimeScale | ||
|
values(num:int = -1):Array
Returns a set of label values for this scale.
| TimeScale | ||
| Method | Defined by | ||
|---|---|---|---|
|
formatString(span:int):String
Determines the format string to be used based on a measure of
the time span covered by this scale.
| TimeScale | ||
|
updateScale():void
Updates the scale range when the data range is changed.
| TimeScale | ||
| dataMax | property |
dataMax:Date [read-write] The maximum (latest) Date value in the underlying data.
This property is the same as the maximum
property, but properly typed.
public function get dataMax():Date
public function set dataMax(value:Date):void
| dataMin | property |
dataMin:Date [read-write] The minimum (earliest) Date value in the underlying data.
This property is the same as the minimum
property, but properly typed.
public function get dataMin():Date
public function set dataMin(value:Date):void
| flush | property |
flush:Boolean [write-only]Implementation
public function set flush(value:Boolean):void
| labelFormat | property |
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.
public function get labelFormat():String
public function set labelFormat(value:String):void
| max | property |
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
| min | property |
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
| scaleMax | property |
scaleMax:Date [read-only]The maximum (latest) Date value in the underlying data.
Implementation public function get scaleMax():Date
| scaleMin | property |
scaleMin:Date [read-only]The minimum (earliest) Date value in the scale.
Implementation public function get scaleMin():Date
| scaleType | property |
scaleType:String [read-only]A string indicating the type of scale this is.
Implementation public function get scaleType():String
| TimeScale | () | constructor |
public function TimeScale(min:Date = null, max:Date = null, flush:Boolean = false, labelFormat:String = null)Creates a new TimeScale.
Parametersmin:Date (default = null) — the minimum (earliest) date value
|
|
max:Date (default = null) — the maximum (latest) date value
|
|
flush:Boolean (default = false) — the flush flag for scale padding
|
|
labelFormat:String (default = null) — the formatting pattern for value labels
|
| clone | () | method |
public override function clone():ScaleReturns a cloned copy of the scale.
ReturnsScale —
a cloned scale.
|
| formatString | () | method |
protected function formatString(span:int):StringDetermines the format string to be used based on a measure of the time span covered by this scale.
Parametersspan:int — the time span covered by this scale. Should use the
format of the flare.util.Dates class.
|
String — the label formatting pattern
|
| interpolate | () | method |
public override function interpolate(value:Object):NumberReturns an interpolation fraction indicating the position of the input value within the scale range.
Parametersvalue:Object — a data value for which to return an interpolation
fraction along the data scale
|
Number — the interpolation fraction of the value in the data scale
|
| lookup | () | method |
public override function lookup(f:Number):ObjectPerforms a reverse lookup, returning an object value corresponding to a interpolation fraction along the scale range.
Parametersf:Number — the interpolation fraction
|
Object — the scale value at the interpolation fraction. May return
null if no value corresponds to the input fraction.
|
| updateScale | () | method |
protected function updateScale():voidUpdates the scale range when the data range is changed.
| values | () | method |
public override function values(num:int = -1):ArrayReturns a set of label values for this scale.
Parametersnum:int (default = -1) — a desired target number of labels. This parameter is
handled idiosyncratically by different scale sub-classes.
|
Array — an array of label values for the scale
|