I have a problem where I'm trying to add a series to a line chart and it just
doesn't work correctly.

Here's a test fiel that i created to test this. has anyone ever been able to
get this to work? I can get the chart created, the dataprovider is
added/updated on the chart, but the graph never updates correctly. and it
doesn't add the series into the chart. Nothing is drawn!

Has anyone found a way to make the charts update dynamically?

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml" xmlns="*"
horizontalAlign="left" verticalAlign="top" xmlns:cell="cellrenders.*"
creationComplete="initFunc();">

<mx:Script>
<![CDATA[
import de.richinternet.utils.Dumper;
import mx.charts.series.LineSeries;

public var arrGraph:Array = new Array(10);
public var graphNum:Number = 0;

private function initFunc():Void {
var thisobj = new Object();
var j:Number = 0;
for (var i=0;i<100;i=i+10) {
thisobj.timeval = new String("thismonth"+i);
thisobj.propval = i;
arrGraph.push(thisobj);
}
}

public function CreateGraph():Void {
var ls:Object;

myPanel.createChild(mx.charts.LineChart,"lineChart "+graphNum,{width:"200",he
ight:"100"});
ls = new LineSeries();
ls.dataProvider = arrGraph;
ls.setStyle("stroke", new mx.graphics.Stroke(0x000000,2,100));
ls.name = "machine"+graphNum; // ID of series as "ABC.AC"
ls.xField = "timeval";
ls.yField = "propval";
//ls.renderer=new SimpleLineRenderer(); // no line shadow
//myChart.series.addItem(ls);
//dg.dataProvider = UpdateResult;
myPanel["lineChart"+graphNum].series.addItem(ls);
myPanel["lineChart"+graphNum].series.update();
//mySeries = graphTile["lineChart"+i].createChildAtDepth("Blah",
graphTile["lineChart"+i].findNextAvailableDepth(),{dataProvider:chartPrope rtyObj
["machineval"+machinePoolObj[j]],renderer:
mx.charts.renderers.SimpleLineRenderer,series:new Array() });
//Dumper.dump(mySeries);
//graphTile["lineChart"+i].createChildren();
myPanel["lineChart"+graphNum].invalidate();
graphNum++;
}
]]>
</mx:Script>


<mx:Panel title="Graph" id="myPanel">
<mx:Button label="Graph it" click="CreateGraph()"/>
</mx:Panel>

</mx:Application>