ajax update

« 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 johan on 11th August 2013
hi there,

i've made a nice example with your gauge, i am using a mysql database for the data. it's showing the value in my gauge, but for updating the gauge i want to use ajax..

just like in: www.rgraph.net/demos/gauge-ajax.html

i've copied the gauge-ajax.html and getdata.html to the correct location on my webserver (just for trying), but no updates, no moves...

the link: www.rgraph.net/demos/gauge-ajax.html works fine, and that is what i want..


Posted by RGraph support on 12th August 2013
Hi there,

Remember that if the file on your server doesn't change - neither will your Gauge. The getData.html file on rgraph.net is actually a script and changes every time you get the file (try hitting refresh to see the data change). For testing try just using a random number:

setInterval(function ()
     // obj.value = RGraph.AJAX.getNumber('/getData.html');

     obj.value = RGraph.random(0,100);
}, 1000)

And then, when you have that working, change it to get the new value from AJAX instead of it being generated randomly.

Richard, RGraph Support

Help support RGraph - single site license only £99

Add a reply


« Back to message list
RGraph on social media