I am creating an ArrayCollection through a loop and afterwards want to use this ArrayCollection to build a line chart. The only problem is that I have only values in my ArrayCollection and no keywords, which are used to build a line chart. How can I add keywords to my ArrayCollection? Or is there a way to build a linechart without keywords?
here is the code of creating the arraycollection:
[Bindable] public var Graph_:ArrayCollection;
public function populateArray():void {
var Graph_:ArrayCollection = new ArrayCollection();
for (var i:int=0; i<=500; i++){
var depth_:Number = i*10;
var pressure:Number = 100+i;
Graph_.addItem([depth_,pressure]);
}
// I want to use it further in this way:
<mx:LineChart id="chart"
dataProvider= "{Graph_}"
showDataTips="true">
<mx:horizontalAxis>
<mx:CategoryAxis categoryField="Depth" />
</mx:horizontalAxis>
<mx:series>
<mx:LineSeries yField="Pressure" form="curve" displayName="Pressure"/>
</mx:series>
</mx:LineChart>