PDA

View Full Version : Dynamic Series in scatter chart



sandeepmnit35
15 Oct 2012, 3:12 AM
How can I create dynamic series in scatter chart?

I want to create the series on the basic of database output.

Any kind of input will be helpful to me.
Thanks

mitchellsimoens
17 Oct 2012, 5:25 AM
What I usually do is load the chart and when it has been loaded create the chart and add it to the container.

You can try to add series and axis but I find that unstable for my uses.

sandeepmnit35
18 Oct 2012, 1:35 AM
I need to create series on the basis of database result so is there any way to create series with looping in sencha touch ?

Please see below code but it is not working:


var myChart = Ext.create('Ext.chart.Chart',{ id:'myChart', renderTo:'myPanel', axes:[], // blank because i need to add axes from store series:[] // blank because i need to add series from store : : }); for(conditions){ myChart.config.axes[0].fields.push(record[cnt].data.fieldName); var series = { type:'scatter', axis:['right', 'bottom'], xField:'myXfield', yField:record[cnt].data.yfieldVal } myChart.config.series.push(series); }//for loop ends myChart.redraw();
Iam not able to see the chart with the plots that are dynamically added.