Gauge grow function is buggy

« 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 smartbloke on 2nd April 2014
There is a problem with the Gauge grow function for a single needle gauge in that it always misses the last iteration and therefore animates the needle to an incorrect position.

The problem is the following line (1170 in RGraph.gauge.js);-

if (++frame < frames ) {

This should read;-

if (frame++ < frames) {

If this change is made then the grow function leaves the needle at the same place as the draw function.

I notice also there is a variable 'step' which is calculated but never used on line 1157.

The step variable is also calculated for the multiple pointers version of the grow function on line 1199 and 1203 but again is never used. The iterator function for the multiple pointer gauge seems to count frames correctly, although I have not tested it.

This code is the same for the stable version and the beta.
Posted by Richard on 2nd April 2014
Hi there,

Thanks - I've updated the Gauge and the fix will be in the next version. When it is you'll be able to see a demo of the Gauge chart Grow effect here:

(At the moment it's a demo of the multiple pointers version of the Gauge)


If RGraph has helped you - please share the website - thanks!

Add a reply


« Back to message list
RGraph on social media