Create Dataset dynamically for flot graphs to plot graph

dos3

New Member
I am trying to put data using the loop but the dataset structure used in flot examples is fixed i want to get data using loop . Using in this way-\[code\]var datasets = { "graph1": { label: 'graph1', data: format(datagrap1) }, "graph2": { label: 'graph2', data: format(datagraph2), yaxis: 2 }, "graph3": { label: 'graph3', data: format(datagraph2), yaxis: 3 } };\[/code\]Want to use like this in which i csan iterate through loop . I tried in this way-\[code\] var len = somearray.length ; for(var i=0;i<len-1;i++) { var si = somearray; var datasets = { "si": { label: 'si'+i, data: format(eval(si)) } }\[/code\]Here "si" is containing data in it and it will change as per loop in each iteration . How can i go for it for this situation ?Any help or suggestion will be appreciated . Thanks in advance !!
 
Back
Top