
166 Additional Migration Issues
Skins
Skins are now called renderers. For example, the CandlestickSkin class is now
CandlestickRenderer.
Renderers
Some functionality for the AxisRenderer was moved to other axis objects.
The
labelFunction property, which was a property of AxisRenderer, is now a property of the
axis type (such as CategoryAxis). The signature for the function is changed as well. Instead of
a single parameter,
the labelFunction() function now takes up to four. The new signature
is as follows:
labelFunction(categoryValue:Object, previousCategoryValue:Object,
axis:axis_type, categoryItem:Object);
For more information on using the labelFunction property, see the Flex 2 Developer’s Guide.
The
title property was also moved to the individual axis rather than the axis renderer. For
example, in Flex 1.x you defined both the horizontalAxis and the horizontalAxisRenderer, as
the following example shows:
<mx:horizontalAxis>
<mx:CategoryAxis dataProvider="{expenses}" categoryField="Month"/>
</mx:horizontalAxis>
<mx:horizontalAxisRenderer>
<mx:AxisRenderer title="Expenses" labelFunction="defineLabel"/>
</mx:horizontalAxisRenderer>
In Flex 2, you set the title and labelFunction properties on the horizontalAxis:
<mx:horizontalAxis>
<mx:CategoryAxis dataProvider="{expenses}" categoryField="Month"
title="Expenses" labelFunction="defineLabel"/>
</mx:horizontalAxis>
You no longer use renderers to change the appearance of ChartItems. In Flex 1.x, for example,
you could specify a CrossRenderer or TriangleRenderer to draw a ChartItem as a cross or a
triangle:
<mx:PlotSeries>
<mx:renderer>
<mx:CrossRenderer/>
</mx:renderer>
</mx:PlotSeries>
Commenti su questo manuale