Thank you for your answers, I have resolved it by having array of "names". But I had a new problem:
I had to have an Object Array like this:
[{
"balloonText": "[[category]]: <b>[[value]]</b>",
"fillAlphas": 0.9,
"lineAlpha": 0.2,
"type": "column",
"valueField": "data1"
}, {
"balloonText": "[[category]]: <b>[[value]]</b>",
"fillAlphas": 0.9,
"lineAlpha": 0.2,
"type": "column",
"valueField": "data2"
},
......
]
Where data1,data2,... are dynamic values given by Names (Names is the array I was looking for), I'm trying by doing this:
var array = new Object();
var res = [];
for (i in Names)
{
array["ballonText"] = "[[category]]: <b>[[value]]</b>";
array["fillAlphas"] = 0.9;
array["lineAlpha"] = 0.2;
array["type"] = "column";
array["valueField"] = Names[i];
res[i] = array;
}
result = res;
return result;
And I got it! I had what I'm looking for, but instead of have the Object Array I have this:
[{
"balloonText": "[[category]]: <b>[[value]]</b>",
"fillAlphas": 0.9,
"lineAlpha": 0.2,
"type": "column",
"valueField": "data2"
}, {
"balloonText": "[[category]]: <b>[[value]]</b>",
"fillAlphas": 0.9,
"lineAlpha": 0.2,
"type": "column",
"valueField": "data2"
},
......
]
It's the same value for valueField, instead of have data1,data2,... I have data2,data2.. Could you please tell me why I'm having the same value for all the elements of my array? thank you!!