How can I redraw my Line chart after each AJAX request?

« 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 Kyle on 10th October 2012

Id like to know how to redraw a line chart after making an ajax request with changed parameters.

Right now it updates fine, but it draws infinitely ontop of each other.
Ive tried using Rgraph.Clear() but to no avail.

Can anybody help?

Posted by RGraph Support on 10th October 2012

Are you creating a new object each time? If so then because the old objects are being "remembered" you'll need to remove them from the ObjectRegistry like this:


or this:


Alternatively you can just update the data properties of of the first object and redraw the chart. With the line chart it's called "original_data". So it would go like this:

obj.original_data = myNewData;
Posted by Kyle on 10th October 2012
Thanks alot, works like a charm now :)

Also without reading your reply to my other question...I finally figured out on my own, the problem with the JSON.
Returning a string "[2,2,1]" instead of a real array.
rrrrgh, thanks anyways

Add a reply

« Back to message list