2010-05-04 37 views
0

如何在my mx:AreaSeries中顯示arrayCollection的內容?FLEX:如何使用arrayCollection填充AreaSeries

arrayCollection = [12,31,12,42]; 
<mx:CartesianChart id="AllChart" dataProvider="{arrayCollection}" width="100%" height="100"> 
       <mx:AreaSeries" /> <!-- how can I refer to the cells ? Should I use associative array ? --> 
</mx:Cartesian Chart> 

感謝

回答

0

你應該陣列集合中使用的對象,比如這裏的例子:

http://livedocs.adobe.com/flex/3/html/help.html?content=charts_types_02.html

即:

arrayCollection = [{val:12},{val:31},{val:12},{val:42}]; 
<mx:CartesianChart id="AllChart" dataProvider="{arrayCollection}" width="100%" height="100"> 
       <mx:AreaSeries yField="val" /> <!-- how can I refer to the cells ? Should I use associative array ? --> 
</mx:Cartesian Chart> 
相關問題