Справочник Пользователя для Macromedia flex 2-migrating applications to flex 2

Скачать
Страница из 184
Charting
167
In Flex 2, you set the value of the series’ 
itemRenderer
 property to a skin class that draws the 
ChartItem’s icon:
<mx:PlotSeries itemRenderer="mx.charts.skins.halo.CrossSkin"/>
In addition, you can no longer use the AssetRenderer to use graphics in your charts. Instead, 
you must use a class that implements the IDataObject interface.
Binding
In many cases, you declare a data provider object and bind the chart to that data provider. In 
Flex 2, you must add the 
[Bindable]
 metadata tag to the variable declaration, otherwise Flex 
does not bind to the data. For example:
<mx:Script>
[Bindable]
// Add this in Flex 2
public var expenses:Object = [{ ... }, { ... }, { ... }];
</mx:Script>
<mx:BubbleChart maxRadius="50" dataProvider="{expenses}
mouseDown events
In Flex 1.5, 
mouseDown
 events included 
hitData
 structures, even if no data was under the 
mouse’s pointer. In this case, the 
hitData
 property existed, but it was 
null
. This behavior was 
a way to check for the existence of a click on a chart control.
In Flex 2, 
mouseDown
 events do not include the 
hitData
 structure unless the mouse is 
positioned over a data point. Instead, you must use the 
mouseDownData
 event.
alpha
All aspects of charting that used an alpha property to represent transparency, such as Strokes 
and Fills, now use 0 to 1 for a range of values rather than 1 to 100. For example:
Flex 1.x:
<mx:SolidColor color="0x7EAEFF" alpha="30"/>
Flex 2:
<mx:SolidColor color="0x7EAEFF" alpha=".3"/>