Clearing the existing chart when drawing a new chart on the canvas

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 Jose on 16th December 2015
Posted by Richard on 16th December 2015
Hi,

Charts are remembered by the RGraph ObjectRegistry so you could clear it as well as clearing the canvas:


RGraph.clear(line.canvas);
RGraph.ObjectRegistry.clear(line.canvas);



More here:

www.rgraph.net/docs/api.html#objectregistry





Richard
Posted by Jose on 16th December 2015
Hi,
thanks for your reply but still no success.

before the line.draw();

I've added this and nothing.

RGraph.clear(line.canvas);
RGraph.ObjectRegistry.clear(line.canvas);
Posted by Richard on 16th December 2015
Hi,

Well that should work. You could reseting the canvas BEFORE you create the object:

RGraph.reset(line.canvas);




Richard

Add a reply




« Back to message list