jQWidgets Forums
Forum Replies Created
-
Author
-
It works Peter.
The objects declaration was not on the right place.To be more comprehensive, I try do something like that :
var myDatafields = [];
var field = new Object();
var mySeries = [];
var serie = new Object();
$.each(result, function(k,v){
if(i==0){
field.name=k;
field.type=’string’;
myDatafields.push(field);
}else{
field.name=k;
field.type=’int’;
myDatafields.push(field);
serie.dataField=k;
serie.displayText=k;
mySeries.push(serie);
}
i++;
});Thanks Peter.
I followed your explanation and it works.
Now I would like to make it totally dynamic, I mean a dynamic datafields param for the source and dynamic series.
Can I build arrays for datafields param and series ?
Thanks in advance.Hi Peter.
My data format is not a json object but an array. As you can see, data returned by ajax call is converted in an array :source_data = $.makeArray(data);Your answer induces a new question :
How to declare setup multiple series when you don’t know in advance its number and their names ?Hi Dimitar and thanks for your answer.
My original data representation was based on a “simple” sql query. Re-formatting will need some manipulations. -
AuthorPosts