How can I implement a dynamic Line chart and a dynamic Bar chart?

« 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 Schultz on 1st January 2016

I was wondering the best approach to implementing a dynamic line graph and dynamic bar graph. The data is being called from a server using AJAX. I also need these to be in two different canvases.

Thank you!
Posted by RGraph support on 18th July 2013
Hi there,

You simply set the new data in the chart object using the appropriate data property and then call RGraph.Redraw(). You can see a list of the relevant data properties here:

And the basic AJAX examples:

And the Line chart demos:

eg For the Line chart you could do this:

newdata = [get new data via AJAX]
myLine.original_data[0] = newdata; // Updates the first dataset

Similarly with the Bar chart:

newdata = [get new data via AJAX] = newdata;


Add a reply

« Back to message list