Packageflare.vis.legend
Classpublic class LegendRange
InheritanceLegendRange Inheritance RectSprite Inheritance DirtySprite Inheritance flash.display.Sprite
ImplementsIScaleMap

A range in a continuous legend, consisting of a continuous visual scale and value labels. Legend ranges use a ColorPalette instance for creating a gradient of color values. If the stats property is set with the Stats object for a backing data variable, a histogram of values will also be drawn in the legend range. To draw only a histogram, set the palette property to null.



Public Properties
 PropertyDefined by
 Inheritedangle : Number
The angle value of this sprite's position in polar co-ordinates.
DirtySprite
  borderColor : uint
The color of the legend range border.
LegendRange
  bounds : Rectangle
[read-only] Bounds for the visual range portion of this legend range.
LegendRange
 InheritedcornerHeight : Number
The height of rounded corners.
RectSprite
 InheritedcornerSize : Number
Sets corner width and height simultaneously.
RectSprite
 InheritedcornerWidth : Number
The width of rounded corners.
RectSprite
  dataField : String
[read-only] The data field described by this legend range.
LegendRange
 InheritedfillColor : uint
The fill color of the rectangle.
RectSprite
 Inheritedh : Number
The height of the rectangle.
RectSprite
 Inheritedheight : Number
If dirty, this sprite is re-rendered before returning the height.
DirtySprite
  histogramColor : uint
The color of bars in a generated histogram.
LegendRange
  labels : Sprite
[read-only] Sprite containing the range's labels.
LegendRange
  labelTextFormat : TextFormat
Text format (font, size, style) of legend range labels.
LegendRange
  labelTextMode : int
TextFormat (font, size, style) of legend range labels.
LegendRange
 InheritedlineColor : uint
The line color of the rectangle outline.
RectSprite
 InheritedlinePixelHinting : Boolean
Flag indicating if pixel hinting should be used for the outline.
RectSprite
 InheritedlineWidth : Number
The line width of the rectangle outline.
RectSprite
  margin : Number
Margin value for padding within the legend item.
LegendRange
  orientation : String
The desired orientation of this legend range.
LegendRange
 Inheritedorigin : Point
The origin point for polar coordinates.
DirtySprite
 Inheritedradius : Number
The radius value of this sprite's position in polar co-ordinates.
DirtySprite
  rangeSize : Number
The size of the range, this is either the width or height of the range, depending on the current orientation.
LegendRange
  stats : Stats
Stats object describing the data range.
LegendRange
 Inheritedw : Number
The width of the rectangle.
RectSprite
 Inheritedwidth : Number
If dirty, this sprite is re-rendered before returning the width.
DirtySprite
 Inheritedx : Number
DirtySprite
  x1 : Number
[read-only] Returns the x-coordinate corresponding to the lower end of the scale.
LegendRange
  x2 : Number
[read-only] Returns the x-coordinate corresponding to the upper end of the scale.
LegendRange
 Inheritedy : Number
DirtySprite
  y1 : Number
[read-only] Returns the y-coordinate corresponding to the lower end of the scale.
LegendRange
  y2 : Number
[read-only] Returns the y-coordinate corresponding to the upper end of the scale.
LegendRange
Protected Properties
 PropertyDefined by
 Inherited_angle : Number
The angle value of this sprite's position in polar co-ordinates.
DirtySprite
 Inherited_origin : Point
The origin point for polar coordinates.
DirtySprite
 Inherited_radius : Number
The radius value of this sprite's position in polar co-ordinates.
DirtySprite
Public Methods
 MethodDefined by
  
LegendRange(dataField:String, scale:Scale, palette:ColorPalette = null, orientation:String)
Creates a new LegendRange.
LegendRange
 Inherited
dirty():void
Marks this sprite as "dirty" and in need of re-rendering.
DirtySprite
 Inherited
getBounds(targetCoordinateSpace:DisplayObject):Rectangle
If dirty, this sprite is re-rendered returning the bounds.
DirtySprite
 Inherited
getRect(targetCoordinateSpace:DisplayObject):Rectangle
If dirty, this sprite is re-rendered before returning the rect.
DirtySprite
 Inherited
hitTestObject(obj:DisplayObject):Boolean
If dirty, either sprite is re-rendered before hit-testing.
DirtySprite
 Inherited
hitTestPoint(x:Number, y:Number, shapeFlag:Boolean = false):Boolean
If dirty, this sprite is re-rendered before hit-testing.
DirtySprite
  
render():void
Draw this sprite's graphical content.
LegendRange
 Inherited
renderDirty(evt:Event = null):void
[static] Frame render callback that renders all sprites on the dirty list.
DirtySprite
 Inherited
toString():String
DirtySprite
  
updateLabels():void
Update the labels shown by this legend range.
LegendRange
  
value(x:Number, y:Number, stayInBounds:Boolean = true):Object
Returns the scale value corresponding to a given coordinate.
LegendRange
  
X(val:Object):Number
Returns the x-coordinate corresponding to the given scale value
LegendRange
  
Y(val:Object):Number
Returns the y-coordinate corresponding to the given scale value
LegendRange
Protected Methods
 MethodDefined by
  
drawHistogram(w:Number, h:Number):void
Draws a histogram of data values in the range dispay.
LegendRange
  
drawPalette(w:Number, h:Number):void
Draws a continuous color range in the range display.
LegendRange
Public Constants
 ConstantDefined by
 InheritedZERO : Point
[static] A constant for the point (0,0).
DirtySprite
Property detail
borderColorproperty
borderColor:uint  [read-write]

The color of the legend range border.

Implementation
    public function get borderColor():uint
    public function set borderColor(value:uint):void
boundsproperty 
bounds:Rectangle  [read-only]

Bounds for the visual range portion of this legend range.

Implementation
    public function get bounds():Rectangle
dataFieldproperty 
dataField:String  [read-only]

The data field described by this legend range.

Implementation
    public function get dataField():String
histogramColorproperty 
histogramColor:uint  [read-write]

The color of bars in a generated histogram.

Implementation
    public function get histogramColor():uint
    public function set histogramColor(value:uint):void
labelsproperty 
labels:Sprite  [read-only]

Sprite containing the range's labels.

Implementation
    public function get labels():Sprite
labelTextFormatproperty 
labelTextFormat:TextFormat  [read-write]

Text format (font, size, style) of legend range labels.

Implementation
    public function get labelTextFormat():TextFormat
    public function set labelTextFormat(value:TextFormat):void
labelTextModeproperty 
labelTextMode:int  [read-write]

TextFormat (font, size, style) of legend range labels.

Implementation
    public function get labelTextMode():int
    public function set labelTextMode(value:int):void
marginproperty 
margin:Number  [read-write]

Margin value for padding within the legend item.

Implementation
    public function get margin():Number
    public function set margin(value:Number):void
orientationproperty 
orientation:String  [read-write]

The desired orientation of this legend range.

Implementation
    public function get orientation():String
    public function set orientation(value:String):void
rangeSizeproperty 
rangeSize:Number  [read-write]

The size of the range, this is either the width or height of the range, depending on the current orientation.

Implementation
    public function get rangeSize():Number
    public function set rangeSize(value:Number):void
statsproperty 
stats:Stats  [read-write]

Stats object describing the data range.

Implementation
    public function get stats():Stats
    public function set stats(value:Stats):void
x1property 
x1:Number  [read-only]

Returns the x-coordinate corresponding to the lower end of the scale.

Implementation
    public function get x1():Number
x2property 
x2:Number  [read-only]

Returns the x-coordinate corresponding to the upper end of the scale.

Implementation
    public function get x2():Number
y1property 
y1:Number  [read-only]

Returns the y-coordinate corresponding to the lower end of the scale.

Implementation
    public function get y1():Number
y2property 
y2:Number  [read-only]

Returns the y-coordinate corresponding to the upper end of the scale.

Implementation
    public function get y2():Number
Constructor detail
LegendRange()constructor
public function LegendRange(dataField:String, scale:Scale, palette:ColorPalette = null, orientation:String)

Creates a new LegendRange.

Parameters
dataField:String — the data field described by this range
 
scale:Scale — the color palette for the data field
 
palette:ColorPalette (default = null) — the Scale instance mapping the data field to a visual variable
 
orientation:String
Method detail
drawHistogram()method
protected function drawHistogram(w:Number, h:Number):void

Draws a histogram of data values in the range dispay.

Parameters
w:Number — the width of the range display
 
h:Number — the height of the range display
drawPalette()method 
protected function drawPalette(w:Number, h:Number):void

Draws a continuous color range in the range display.

Parameters
w:Number — the width of the range display
 
h:Number — the height of the range display
render()method 
public override function render():void

Draw this sprite's graphical content. Subclasses should override this method with custom drawing code.

updateLabels()method 
public function updateLabels():void

Update the labels shown by this legend range.

value()method 
public function value(x:Number, y:Number, stayInBounds:Boolean = true):Object

Returns the scale value corresponding to a given coordinate.

Parameters
x:Number — the x-coordinate
 
y:Number — the y-coordinate
 
stayInBounds:Boolean (default = true) — if true, x,y values outside the current layout bounds will be snapped to the bounds. If false, the value lookup will attempt to extrapolate beyond the scale bounds. This value is true be default.

Returns
Object — the scale value corresponding to the given coordinate.
X()method 
public function X(val:Object):Number

Returns the x-coordinate corresponding to the given scale value

Parameters
val:Object — the scale value to lookup

Returns
Number — the x-coordinate at which that scale value is placed
Y()method 
public function Y(val:Object):Number

Returns the y-coordinate corresponding to the given scale value

Parameters
val:Object — the scale value to lookup

Returns
Number — the y-coordinate at which that scale value is placed