How do I get AJAX updating working with my Gauge?

« 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:

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: 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 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

Add a reply

« Back to message list