Data Update In Real Time
<?xml version="1.0"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" initialize="initTimer()"> <mx:Script> import flash.utils.Timer; import flash.events.TimerEvent; import mx.collections.ArrayCollection; [Bindable] public var myArray:ArrayCollection = new ArrayCollection(); public function initTimer():void { var myTimer:Timer = new Timer(1000, 0); myTimer.addEventListener("timer", timerHandler); myTimer.start(); } public function timerHandler(event:TimerEvent):void { var obj:Object = new Object(); obj.time = getTimer(); obj.stockPrice += 1; myArray.addItem(obj); } </mx:Script> <mx:LineChart id="chart" dataProvider="{myArray}" showDataTips="true"> <mx:horizontalAxis> <mx:LinearAxis/> </mx:horizontalAxis> <mx:verticalAxis> <mx:LinearAxis minimum="35"/> </mx:verticalAxis> <mx:series> <mx:LineSeries yField="stockPrice"/> </mx:series> </mx:LineChart> </mx:Application>