I have run into this same problem before and found two solutions. I prefer
the first method below.
1) Create a [Bindable] Array variable to push your Series objects into and
then use <mx:PlotChart id="investment_chart"
series="{myBindableArrayOfSeriesObjects}" />
2) Before pushing Series objects into the chart.series array, set
chart.series equal to a new Array instance. You can do this in a method
that is called when the view is created.
Either way, chart.series needs an array to push the series objects into.
Let me know if that works out for you.
Scot
On Jan 24, 2008 5:05 PM, <[EMAIL PROTECTED]> wrote:
> I am trying to create a graph that charts cashflows for each investment.
> Depending on the user there are a different number of investments. So this
> function is run for each investment. Because I do a messateService request
> from the web server for each investment.
>
> * private function onGetCashflows(e:ResultEvent):void*
>
> * {*
>
> * var new_series:PlotSeries=new PlotSeries();*
>
> * new_series.xField="contr_date";*
>
> * new_series.yField="contr_value";*
>
> * var series:ArrayCollection=new ArrayCollection([]);*
>
> * if (e.result.cashflow.length > 0)*
>
> * {*
>
> * var idx:int=findInvestmentIdx(e.result.cashflow
> [0].investment_id,investments);*
>
> * if (idx == -1)*
>
> * {*
>
> * return;*
>
> * }*
>
> * var series_name:String =e.result["inv_name"];*
>
> * *
>
> * new_series.dataProvider=e.result.cashflow;*
>
> * investment_chart.series.push(new_series);*
>
> * *
>
> * }*
>
> * *
>
> * }*
>
> The MXML for the chart looks like this.
>
> <mx:PlotChart id="investment_chart" />
>
>
>
> The chart is just not being generated even though I can tell it is being
> run in the debugger.
>
>
>
> I've done charts before using fixed number of series and using
> *dataProvider='{variable}'
> * but I am really stuck on this.
>
> Any help would be appreciated.
>
>
>
> ·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´
>
> Tommie Jones
>
> Team Supervisor
>
> Sunrise Telecom - We Make Networks Work
>
> Office +1 678.808.3615
>
> This message may contain confidential and/or privileged information. If
> you are not authorized to receive this, please advise the sender immediately
> by reply e-mail and delete this --------------------
>
> -------------------------------------------------------------
> To unsubscribe from this list, simply email the list with unsubscribe in
> the subject line
>
> For more info, see http://www.affug.com
> Archive @ http://www.mail-archive.com/discussion%40affug.com/
> List hosted by FusionLink <http://www.fusionlink.com>
> -------------------------------------------------------------
-------------------------------------------------------------
To unsubscribe from this list, simply email the list with unsubscribe in the
subject line
For more info, see http://www.affug.com
Archive @ http://www.mail-archive.com/discussion%40affug.com/
List hosted by http://www.fusionlink.com
-------------------------------------------------------------