I ended up doing this ...

ca3a.splice.apply(ca3a,[ca3a.length,0].concat(data[obj]));
ca3a.sortOn("loadval");
ca3.dataProvider = ca3a;

... for each possible axis. Seems like there should be an easier way to do 
this, without having to define temporary holding variables. This solution also 
ends up with duplicates (since each line is added separately, they should at 
some point have horizontal values that are the same), which causes the graph to 
do all sorts of fun things.

T

--- In [email protected], "Trefalgar Bain" <trefal...@...> wrote:
>
> --- In [email protected], "valdhor" <valdhorlists@> wrote:
> > Give the CategoryAxis an id...
> > <mx:CategoryAxis id="ca" categoryField="loadval"/>
> > then, in Actionscript, give it a dataProvider...
> > ca.dataProvider = testdata;
> 
> Absolutely right. That's annoying ;)
> 
> I'm now trying to figure out how to dynamically take the current CatagoryAxis 
> dataProvider and append additional data to it. Probably my fault for not 
> posting the entire context ...
> 
> private function graphSetup(data:Object, chart:String):void {
>       for ( var obj:Object in data ) {
>               var ls:LineSeries = new LineSeries();
>               ls.dataProvider = data[obj];
>               ls.yField = "val";
>               ls.xField = "loadval";
>               ls.displayName = obj.valueOf();
>               ls.setStyle('itemRenderer', new 
> ClassFactory(CircleItemRenderer));
>               var currentSeries:Array = linechart1.series;
>               currentSeries.push(ls);
>               linechart1.series = currentSeries;
>               ca1.dataProvider.push(data[obj]);
>       }
> }
> 
> ca1.dataProvider.push doesn't work, it actually ends up setting 
> ca1.dataProvider to null. I can't do this, either ...
> 
> var moo:Array = ca1.dataProvider;
> moo.push(data[obj]);
> ca1.dataProvider = moo;
> 
> If I ... ca1.dataProvider = data[obj] ... it works but for just a single line 
> series.
> 
> Hrm.
> 
> Tref
>


Reply via email to