Packagecom.scottlogic.sparkline
Classpublic class Sparkline
InheritanceSparkline Inheritance SparklineBase Inheritance mx.core.UIComponent

Sparklines are a small, intense, simple dataword devised by Edward Tufte and first presented in his book entitled Beautiful Evidence. They present a trend line without scale, optionally with markers for the first, last, minimum and maximum values. For further information, please read http://www.edwardtufte.com/bboard/q-and-a-fetch-msg?msg_id=0001OR.

The Sparkline class implements the IListItemRenderer and IDropInListItemRenderer, thereby allowing it to be used as an item renderer in a list control or a data grid. The class also supports standalone instances.



Public Properties
 PropertyDefined By
 Inheriteddata : Object
The data property lets you pass a value to the component when you use it as an item renderer or item editor.
SparklineBase
 InheriteddataProvider : Object
The data provider for this sparkline.
SparklineBase
 InheritedlistData : BaseListData
When a component is used as a drop-in item renderer or drop-in item editor, Flex initializes the listData property of the component with the appropriate data from the list control.
SparklineBase
  normalRange : Array
Specifies the normal range of values on the y-axis.
Sparkline
 InheritedxField : String
Specifies the field of the data provider that determines the x-axis location of each data point.
SparklineBase
  xMaxMarkerEnabled : Boolean
Indicates whether the x-axis maximum marker is visible.
Sparkline
  xMinMarkerEnabled : Boolean
Indicates whether the x-axis minimum marker is visible.
Sparkline
 InheritedyField : String
Specifies the field of the data provider that determines the y-axis location of each data point.
SparklineBase
  yMaxMarkerEnabled : Boolean
Indicates whether the y-axis maximum marker is visible.
Sparkline
  yMinMarkerEnabled : Boolean
Indicates whether the y-axis minimum marker is visible.
Sparkline
Protected Properties
 PropertyDefined By
 Inheritedbounds : Rectangle
The bounds within which the line part of the sparkline should be restricted.
SparklineBase
Public Methods
 MethodDefined By
  
Constructor
Sparkline
Protected Methods
 MethodDefined By
 Inherited
drawBackground(width:Number, height:Number):void
Draws the background for the sparkline.
SparklineBase
 Inherited
Marks the current render data cache as dirty.
SparklineBase
  
updateBounds(width:Number, height:Number):void
[override] Ensures the bounds are up to date.
Sparkline
  
updateData():void
[override] Updates the render data cache to reflect the current data provider values.
Sparkline
 Inherited
If the current render data cache is considered dirty then it updates the cache.
SparklineBase
Styles
 Style Description Defined By
 InheritedType: mx.graphics.IFill CSS Inheritance: no
Sets the background fill for the sparkline.
SparklineBase
  
lineStroke
Type: mx.graphics.IStroke CSS Inheritance: no
Sets the stroke for the actual line. The default colour for a sparkline is grey (0x828282). The default value for the width is 1.
Sparkline
  
markerFill
Type: mx.graphics.IFill CSS Inheritance: no
Sets the fill for the x-axis minimum, x-axis maximum, y-axis minimum and y-axis maximum markers. Note that this will be overridden by any values set for xMinFill, xMaxFill, yMinFill and yMaxFill. The default colour for a marker is blue (0x2963a3).
Sparkline
  
markerRadius
Type: Number Format: Length CSS Inheritance: no
Sets the radius for the x-axis minimum, x-axis maximum, y-axis minimum and y-axis maximum markers. Note that this will be overridden by any values set for xMinRadius, xMaxRadius, yMinRadius and yMaxRadius. The default value is 2.
Sparkline
  
markerStroke
Type: mx.graphics.IStroke CSS Inheritance: no
Sets the stroke for the x-axis minimum, x-axis maximum, y-axis minimum and y-axis maximum markers. Note that this will be overridden by any values set for xMinStroke, xMaxStroke, yMinStroke and yMaxStroke. The default stroke used for a marker is none.
Sparkline
  
normalRangeFill
Type: mx.graphics.IFill CSS Inheritance: no
Sets the fill for the normal range. The default fill is semi-transparent black, i.e. grey.
Sparkline
 InheritedType: Number Format: Length CSS Inheritance: no
Sets the padding to the bottom of the sparkline.
SparklineBase
 InheritedType: Number Format: Length CSS Inheritance: no
Sets the padding to the left of the sparkline.
SparklineBase
 InheritedType: Number Format: Length CSS Inheritance: no
Sets the padding to the right of the sparkline.
SparklineBase
 InheritedType: Number Format: Length CSS Inheritance: no
Sets the padding to the top of the sparkline.
SparklineBase
  
xMaxFill
Type: mx.graphics.IFill CSS Inheritance: no
Sets the fill for the x-axis maximum marker. No default, i.e. the marker fill is used.
Sparkline
  
xMaxRadius
Type: Number Format: Length CSS Inheritance: no
Sets the radius for the x-axis maximum marker. No default, i.e. the marker radius is used.
Sparkline
  
xMaxStroke
Type: mx.graphics.IStroke CSS Inheritance: no
Sets the stroke for the x-axis maximum stroke. No default, i.e. the marker stroke is used.
Sparkline
  
xMinFill
Type: mx.graphics.IFill CSS Inheritance: no
Sets the fill for the x-axis minimum marker. No default, i.e. the marker fill is used.
Sparkline
  
xMinRadius
Type: Number Format: Length CSS Inheritance: no
Sets the radius for the x-axis minimum marker. No default, i.e. the marker radius is used.
Sparkline
  
xMinStroke
Type: mx.graphics.IStroke CSS Inheritance: no
Sets the stroke for the x-axis minimum marker. No default, i.e. the marker stroke is used.
Sparkline
  
yMaxFill
Type: mx.graphics.IFill CSS Inheritance: no
Sets the fill for the y-axis maximum marker. No default, i.e. the marker fill is used.
Sparkline
  
yMaxRadius
Type: Number Format: Length CSS Inheritance: no
Sets the radius for the y-axis maximum marker. No default, i.e. the marker radius is used.
Sparkline
  
yMaxStroke
Type: mx.graphics.IStroke CSS Inheritance: no
Sets the stroke for the y-axis maximum marker. No default, i.e. the marker stroke is used.
Sparkline
  
yMinFill
Type: mx.graphics.IFill CSS Inheritance: no
Sets the fill for the y-axis minimum marker. No default, i.e. the marker fill is used.
Sparkline
  
yMinRadius
Type: Number Format: Length CSS Inheritance: no
Sets the radius for the y-axis minimum marker. No default, i.e. the marker radius is used.
Sparkline
  
yMinStroke
Type: mx.graphics.IStroke CSS Inheritance: no
Sets the stroke for the y-axis minimum marker. No default, i.e. the marker stroke is used.
Sparkline
Property Detail
normalRangeproperty
normalRange:Array

Specifies the normal range of values on the y-axis. Specified as an Array of two values: the minimum value and the maximum value. When null is set, no normal range is drawn.

The default value is null.


Implementation
    public function get normalRange():Array
    public function set normalRange(value:Array):void
xMaxMarkerEnabledproperty 
xMaxMarkerEnabled:Boolean

Indicates whether the x-axis maximum marker is visible. Note that this value will be overridden when markersEnabled is set to false.

The default value is true.


Implementation
    public function get xMaxMarkerEnabled():Boolean
    public function set xMaxMarkerEnabled(value:Boolean):void
xMinMarkerEnabledproperty 
xMinMarkerEnabled:Boolean

Indicates whether the x-axis minimum marker is visible. Note that this value will be overridden when markersEnabled is set to false.

The default value is false.


Implementation
    public function get xMinMarkerEnabled():Boolean
    public function set xMinMarkerEnabled(value:Boolean):void
yMaxMarkerEnabledproperty 
yMaxMarkerEnabled:Boolean

Indicates whether the y-axis maximum marker is visible. Note that this value will be overridden when markersEnabled is set to false.

The default value is true.


Implementation
    public function get yMaxMarkerEnabled():Boolean
    public function set yMaxMarkerEnabled(value:Boolean):void
yMinMarkerEnabledproperty 
yMinMarkerEnabled:Boolean

Indicates whether the y-axis minimum marker is visible. Note that this value will be overridden when markersEnabled is set to false.

The default value is true.


Implementation
    public function get yMinMarkerEnabled():Boolean
    public function set yMinMarkerEnabled(value:Boolean):void
Constructor Detail
Sparkline()Constructor
public function Sparkline()

Constructor

Method Detail
updateBounds()method
override protected function updateBounds(width:Number, height:Number):void

Ensures the bounds are up to date.

Parameters

width:Number
 
height:Number

updateData()method 
override protected function updateData():void

Updates the render data cache to reflect the current data provider values. Maps the data provider values to screen coordinates.