套件 | mx.charts.chartClasses |
類別 | public class DataTransform |
繼承 | DataTransform EventDispatcher Object |
子類別 | CartesianTransform, PolarTransform |
語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | 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.
屬性 | 定義自 | ||
---|---|---|---|
axes : Object [唯讀]
The set of axes associated with this transform. | DataTransform | ||
constructor : Object
類別物件的參照或是特定物件實體的建構函數。 | Object | ||
elements : Array
The elements that are associated with this transform. | DataTransform |
方法 | 定義自 | ||
---|---|---|---|
Constructor. | DataTransform | ||
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
會在 EventDispatcher 物件註冊事件偵聽程式,以便讓偵聽程式收到事件的通知。 | 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 | ||
會將事件傳送到事件流程。 | EventDispatcher | ||
Retrieves the axis instance responsible for transforming
the data dimension specified by the dimension parameter. | DataTransform | ||
會檢查 EventDispatcher 物件是否有對特定的事件類型註冊偵聽程式。 | EventDispatcher | ||
指出物件是否有已定義的指定屬性。 | Object | ||
Transforms x and y coordinates relative to the DataTransform
coordinate system into a two-dimensional value in data space. | DataTransform | ||
指出 Object 類別的實體是否位於指定為參數的物件原型鏈中。 | Object | ||
指出指定的屬性是否存在,以及是否可列舉。 | Object | ||
會從 EventDispatcher 物件移除偵聽程式。 | EventDispatcher | ||
Assigns an axis instance to a particular dimension of the transform. | DataTransform | ||
為迴圈作業設定動態屬性的可用性。 | Object | ||
傳回代表此物件的字串,根據地區特定慣例進行格式化。 | 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 | ||
會傳回指定之物件的基本值。 | Object | ||
檢查此 EventDispatcher 物件是否已註冊事件偵聽程式,或者此物件的任何祖系已為特定事件類型註冊事件偵聽程式。 | EventDispatcher |
事件 | 摘要 | 定義自 | ||
---|---|---|---|---|
[廣播事件] 當 Flash Player 或 AIR 應用程式取得作業系統焦點並成為作用中時傳送。 | EventDispatcher | |||
[廣播事件] 當 Flash Player 或 AIR 應用程式失去作業系統焦點並成為非作用中時傳送。 | 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 | 屬性 |
elements | 屬性 |
elements:Array
語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | 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.
實作
public function get elements():Array
public function set elements(value:Array):void
DataTransform | () | 建構函式 |
public function DataTransform()
語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | Flash Player 9, AIR 1.1 |
Constructor.
dataChanged | () | 方法 |
public function dataChanged():void
語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | 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 | () | 方法 |
public function describeData(dimension:String, requiredFields:uint):Array
語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | 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.
參數
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 | () | 方法 |
public function getAxis(dimension:String):IAxis
語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | 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
.
參數
dimension:String — The dimension whose axis is responsible
for transforming the data.
|
IAxis — The axis instance.
|
相關 API 元素
invertTransform | () | 方法 |
public function invertTransform(... values):Array
語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | 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.
參數
... values — The x and y positions (in that order).
|
Array — An Array containing the transformed values.
|
setAxis | () | 方法 |
public function setAxis(dimension:String, v:IAxis):void
語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | 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.
參數
dimension:String — The dimension of the transform.
| |
v:IAxis — The target axis instance.
|
transformCache | () | 方法 |
public function transformCache(cache:Array, xField:String, xConvertedField:String, yField:String, yConvertedField:String):void
語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | 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.
參數
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 | 事件 |
mx.events.FlexEvent
屬性 FlexEvent.type =
mx.events.FlexEvent.TRANSFORM_CHANGE
語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | 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. |
Tue Jun 12 2018, 03:47 PM Z