| Package | com.scottlogic.sparkline |
| Class | public class Sparkline |
| Inheritance | Sparkline SparklineBase mx.core.UIComponent |
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.
| Property | Defined By | ||
|---|---|---|---|
![]() | data : Object
The data property lets you pass a value
to the component when you use it as an item renderer or item editor. | SparklineBase | |
![]() | dataProvider : Object
The data provider for this sparkline. | SparklineBase | |
![]() | listData : 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 | ||
![]() | xField : 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 | ||
![]() | yField : 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 | ||
| Method | Defined By | ||
|---|---|---|---|
Constructor
| Sparkline | ||
| Method | Defined By | ||
|---|---|---|---|
![]() | drawBackground(width:Number, height:Number):void
Draws the background for the sparkline. | SparklineBase | |
![]() | invalidateData():void
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 | ||
![]() | validateData():void
If the current render data cache is considered dirty then
it updates the cache. | SparklineBase | |
| Style | Description | Defined By | ||
|---|---|---|---|---|
![]() | Type: 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 | ||
![]() | Type: Number Format: Length CSS Inheritance: no Sets the padding to the bottom of the sparkline. | SparklineBase | ||
![]() | Type: Number Format: Length CSS Inheritance: no Sets the padding to the left of the sparkline. | SparklineBase | ||
![]() | Type: Number Format: Length CSS Inheritance: no Sets the padding to the right of the sparkline. | SparklineBase | ||
![]() | Type: 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 | ||
| normalRange | property |
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.
public function get normalRange():Array public function set normalRange(value:Array):void| xMaxMarkerEnabled | property |
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.
public function get xMaxMarkerEnabled():Boolean public function set xMaxMarkerEnabled(value:Boolean):void| xMinMarkerEnabled | property |
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.
public function get xMinMarkerEnabled():Boolean public function set xMinMarkerEnabled(value:Boolean):void| yMaxMarkerEnabled | property |
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.
public function get yMaxMarkerEnabled():Boolean public function set yMaxMarkerEnabled(value:Boolean):void| yMinMarkerEnabled | property |
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.
public function get yMinMarkerEnabled():Boolean public function set yMinMarkerEnabled(value:Boolean):void| Sparkline | () | Constructor |
public function Sparkline()Constructor
| updateBounds | () | method |
override protected function updateBounds(width:Number, height:Number):voidEnsures the bounds are up to date.
Parameters
width:Number | |
height:Number |
| updateData | () | method |
override protected function updateData():voidUpdates the render data cache to reflect the current data provider values. Maps the data provider values to screen coordinates.