Package | mx.charts.chartClasses |
Class | public class DataTransform |
Inheritance | DataTransform EventDispatcher Object |
Subclasses | CartesianTransform, PolarTransform |
Language Version: | ActionScript 3.0 |
Product Version: | Flex 3 |
Runtime Versions: | Flash Player 9, AIR 1.1 |
In theory, a chart can contain multiple overlaid DataTransform objects. This allows you to display a chart with multiple data sets rendered in the same area but with different ranges. For example, you might want to show monthly revenues compared to the number of units sold. If revenue was typically in millions while units was typically in the thousands, it would be difficult to render these effectively along the same range. Overlaying them in different DataTransform objects allows the end user to compare trends in the values when they are rendered with different ranges.
Charts can only contain one set of DataTransform.
Most of the time, you will use the ChartBase object, which hides the existance of the DataTransform object between the chart and its contained glyphs and axis objects. If you create your own ChartElement objects, you must understand the methods of the DataTransform class to correctly implement their element.
Property | Defined By | ||
---|---|---|---|
axes : Object [read-only]
The set of axes associated with this transform. | DataTransform | ||
constructor : Object
A reference to the class object or constructor function for a given object instance. | Object | ||
elements : Array
The elements that are associated with this transform. | DataTransform |
Method | Defined By | ||
---|---|---|---|
Constructor. | DataTransform | ||
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Registers an event listener object with an EventDispatcher object so that the listener
receives notification of an event. | EventDispatcher | ||
Informs the DataTransform that some of the underlying data
being represented on the chart has changed. | DataTransform | ||
Collects important displayed values for all elements
associated with this data transform. | DataTransform | ||
Dispatches an event into the event flow. | EventDispatcher | ||
Retrieves the axis instance responsible for transforming
the data dimension specified by the dimension parameter. | DataTransform | ||
Checks whether the EventDispatcher object has any listeners registered for a specific type
of event. | EventDispatcher | ||
Indicates whether an object has a specified property defined. | Object | ||
Transforms x and y coordinates relative to the DataTransform
coordinate system into a two-dimensional value in data space. | DataTransform | ||
Indicates whether an instance of the Object class is in the prototype chain of the object specified
as the parameter. | Object | ||
Indicates whether the specified property exists and is enumerable. | Object | ||
Removes a listener from the EventDispatcher object. | EventDispatcher | ||
Assigns an axis instance to a particular dimension of the transform. | DataTransform | ||
Sets the availability of a dynamic property for loop operations. | Object | ||
Returns the string representation of this object, formatted according to locale-specific conventions. | Object | ||
Returns the string representation of the specified object. | Object | ||
transformCache(cache:Array, xField:String, xConvertedField:String, yField:String, yConvertedField:String):void
Maps a set of numeric values representing data to screen coordinates. | DataTransform | ||
Returns the primitive value of the specified object. | Object | ||
Checks whether an event listener is registered with this EventDispatcher object or any of
its ancestors for the specified event type. | EventDispatcher |
Event | Summary | Defined By | ||
---|---|---|---|---|
[broadcast event] Dispatched when the Flash Player or AIR application gains operating system focus and becomes active. | EventDispatcher | |||
[broadcast event] Dispatched when the Flash Player or AIR application operating loses system focus and is becoming inactive. | EventDispatcher | |||
Dispatched when the transformation from data space to screen space has changed, typically either because the axes that make up the transformation have changed in some way, or the data transform itself has size. | DataTransform |
axes | property |
elements | property |
elements:Array
Language Version: | ActionScript 3.0 |
Product Version: | Flex 3 |
Runtime Versions: | Flash Player 9, AIR 1.1 |
The elements that are associated with this transform. This Array includes background, series, and overlay elements associated with the transform. This value is assigned by the enclosing chart object.
Implementation
public function get elements():Array
public function set elements(value:Array):void
DataTransform | () | Constructor |
public function DataTransform()
Language Version: | ActionScript 3.0 |
Product Version: | Flex 3 |
Runtime Versions: | Flash Player 9, AIR 1.1 |
Constructor.
dataChanged | () | method |
public function dataChanged():void
Language Version: | ActionScript 3.0 |
Product Version: | Flex 3 |
Runtime Versions: | Flash Player 9, AIR 1.1 |
Informs the DataTransform that some of the underlying data being represented on the chart has changed. The DataTransform generally has no knowledge of the source of the underlying data being represented by the chart, so glyphs should call this when their data changes so that the DataTransform can recalculate range scales based on their data. This does not invalidate the DataTransform, because there is no guarantee the data has changed. The axis objects (or range objects) must trigger an invalidate event.
describeData | () | method |
public function describeData(dimension:String, requiredFields:uint):Array
Language Version: | ActionScript 3.0 |
Product Version: | Flex 3 |
Runtime Versions: | Flash Player 9, AIR 1.1 |
Collects important displayed values for all elements associated with this data transform. Axis instances call this method to collect the values they need to consider when auto-generating appropriate ranges. This method returns an Array of BoundedValue objects.
To collect important values for the horizontal axis of a CartesianTransform, pass 0. To collect values for the vertical axis, pass 1.
Parameters
dimension:String — The dimension to collect values for.
| |
requiredFields:uint — Defines the data that are required
by this transform.
|
Array — A Array of BoundedValue objects.
|
getAxis | () | method |
public function getAxis(dimension:String):IAxis
Language Version: | ActionScript 3.0 |
Product Version: | Flex 3 |
Runtime Versions: | Flash Player 9, AIR 1.1 |
Retrieves the axis instance responsible for transforming
the data dimension specified by the dimension
parameter.
If no axis has been previously assigned, a default axis is created.
The default axis for all dimensions is a LinearAxis
with the autoAdjust
property set to false
.
Parameters
dimension:String — The dimension whose axis is responsible
for transforming the data.
|
IAxis — The axis instance.
|
Related API Elements
invertTransform | () | method |
public function invertTransform(... values):Array
Language Version: | ActionScript 3.0 |
Product Version: | Flex 3 |
Runtime Versions: | Flash Player 9, AIR 1.1 |
Transforms x and y coordinates relative to the DataTransform coordinate system into a two-dimensional value in data space.
Parameters
... values — The x and y positions (in that order).
|
Array — An Array containing the transformed values.
|
setAxis | () | method |
public function setAxis(dimension:String, v:IAxis):void
Language Version: | ActionScript 3.0 |
Product Version: | Flex 3 |
Runtime Versions: | Flash Player 9, AIR 1.1 |
Assigns an axis instance to a particular dimension of the transform. Axis objects are assigned by the enclosing chart object.
Parameters
dimension:String — The dimension of the transform.
| |
v:IAxis — The target axis instance.
|
transformCache | () | method |
public function transformCache(cache:Array, xField:String, xConvertedField:String, yField:String, yConvertedField:String):void
Language Version: | ActionScript 3.0 |
Product Version: | Flex 3 |
Runtime Versions: | Flash Player 9, AIR 1.1 |
Maps a set of numeric values representing data to screen coordinates.
This method assumes the values are all numbers,
so any non-numeric values must have been previously converted
with the mapCache()
method.
Parameters
cache:Array — An array of objects containing the data values
in their fields. This is also where this function
will store the converted numeric values.
| |
xField:String — The field where the data values for the x axis
can be found.
| |
xConvertedField:String — The field where the mapped x screen coordinate
will be stored.
| |
yField:String — The field where the data values for the y axis
can be found.
| |
yConvertedField:String — The field where the mapped y screen coordinate
will be stored.
|
transformChange | Event |
mx.events.FlexEvent
property FlexEvent.type =
mx.events.FlexEvent.TRANSFORM_CHANGE
Language Version: | ActionScript 3.0 |
Product Version: | Flex 3 |
Runtime Versions: | Flash Player 9, AIR 1.1 |
Dispatched when the transformation from data space to screen space has changed, typically either because the axes that make up the transformation have changed in some way, or the data transform itself has size.
TheFlexEvent.TRANSFORM_CHANGE
constant defines the value of the
type
property of the event object for a transformChange
event.
The properties of the event object have the following values:
Property | Value |
---|---|
bubbles | false |
cancelable | false |
currentTarget | The Object that defines the
event listener that handles the event. For example, if you use
myButton.addEventListener() to register an event listener,
myButton is the value of the currentTarget . |
target | The Object that dispatched the event;
it is not always the Object listening for the event.
Use the currentTarget property to always access the
Object listening for the event. |
Thu Dec 6 2018, 01:12 PM -08:00