This content has been marked as final. Show 5 replies
have you tried the following?
for(var index:int = 0; index < dp.length; ++index)
for (var property:String in dp[index])
trace(property); //this would give you Candidate_20, Candiate_21
trace(dp[index][property]) //gives 345, 450
Hi sorry it's been a while been working on other things.
Unfortunatly that didn't work my code is
private function createLines():void
var ls:LineSeries = new LineSeries();
lineChart.series = [ls]; // associate the array
var tempObj:Object; //create a series for each series of data
for(var index:int = 0; index < dataProvider.length; ++index)
for (var property:String in dataProvider[index])
ls = new LineSeries();
ls.displayName = property;
ls.yField = property;
lineChart.series[index] = ls;
I'm trying to dynamically create a chart and use the dataProvider labels as the ls.displayName and ls.yField but it will not create the chart it works fine if i pass the parameters in manually.
Appriciate any help
Have you debugged to see you are not getting what you want?
If possible create a sample app and test it. If it doesn't work you can either post of send me the code to firstname.lastname@example.org
Hi Sreenivas R
tried to run a trace I get this output
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at mx.core::UIComponent/set initialized()
at Function/ http://adobe.com/AS3/2006/builtin::apply()
It seems there is nothing in property to be accessed?
Sreenivas is suggesting that you debug the code to find out where the error is ocurring.
Put a breakpoint at the top of the function and step through it.
Or sprinkle some trace statements in the cod until you can pin down the problem.