FLEX:如何使用arrayCollection填充AreaSeries

时间:2010-05-04 15:30:49

标签: flex charts

如何在我的mx:AreaSeries中显示arrayCollection的内容?

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>

感谢

1 个答案:

答案 0 :(得分: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>