Destroy method

Share RGraph:   Share or Like RGraph on Facebook!

« Back to message list

Enter your email address to get email updates on this topic. You can stop receiving updates by clicking the link in the update email messages.

Posted by Aris on 23rd May 2016
Hello, is any destroy method?

I have some dashboard page that has a datepicker and all data are changed on click. I would like to avoid different methods between the initial draw and the update event by just destroying the prev chart instances and initial draw them again.

Is that possible?

Thanks.

Posted by Richard on 23rd May 2016
Hi there,

Yes you should be able to just use the reset function instead of the clear function on the canvas (just before you redraw the chart):

var canvas = document.getElementById('cvs');
RGraph.reset(canvas);






Richard
Posted by Aris on 23rd May 2016
Thank you very much for the help!

Does that method unbinds any javascript event listeners? eg the .on()
Posted by Richard on 23rd May 2016
Hi there,

The underlying event listener isn't unbinded - but the object is deleted from the RGraph ObjectRegistry. So event listeners added with .on() will, in effect, indeed be "unbound".




Richard
Posted by Aris on 23rd May 2016
Thank you for the clarification.

Add a reply




« Back to message list