PDA

View Full Version : Charts: remove as series using chart.series.getAt(0) how?



mhmda
23 Feb 2013, 11:46 PM
Hello how can I remove a series from a chart, I know that I can get the series object using getAt(0) or getAt(1) depending on how many serieses I got in my chart.
my question is how can I remove a series from the chart.
main reason is that I give the end user the ability to change the series type: bar, line... so I wan to display the new change at run time by removing the series and adding a new one.

I tried Chart.series.removeAt(0); It removes the legend but the bar or the line still shown !!

I use extjs 4.1.1

thank you,

seanl
26 Feb 2013, 9:46 AM
Maybe try:


chart.series.removeAt(0);
chart.surface.removeAll();
chart.refresh();

mhmda
28 Feb 2013, 4:43 AM
Thank you, I'll try that :-)