PDA

View Full Version : How to get chart type using chart object



jude_ignati
21 Feb 2013, 6:10 PM
Hi,

I have a scenario where there is a chart created inside a panel dynamically. Also have a combo box in the panel with options like 'Bar', 'Pie', and 'Line'.
On click event of combo box, the current chart is removed and new chart is created.

I have a button in the panel. On click of the button, I need to get the type of the chart which is active in panel. I could able to get the chart object. but I don't see any methods the would give me the type of the chart.

I tried getInitialConfig(), but that didn't help. Please throw some pointers.

Thanks

scottmartin
22 Feb 2013, 5:03 PM
Have a look at:

console.log(chart.series.items[0].type);

jude_ignati
23 Feb 2013, 10:06 AM
Thanks for the solution.