I use this library in a dashboard where i do polling to track data changes.
When value of gauge is different from 0, it is updated correctly
When value (during polling) is 0, the value printed inside gauge is correct, but the arch is not redrawed.
An example can be reproduced as is screens in your public website
1) first set value = 30
2) select and delete value (empty = 0)
in gauge text value is correct, but arch remain as 30
Debugging I found that in animate function (row 137), middle is setted as:
var middle = start + previousProgress + displacement * progress;
when value pass from something to 0, displacement is = 0
so middle remain as before
to avoid it, I add this control before set middle
if (displacement == 0) { displacement = - previousProgress; }
so middle will change correctly
I use this library in a dashboard where i do polling to track data changes. When value of gauge is different from 0, it is updated correctly When value (during polling) is 0, the value printed inside gauge is correct, but the arch is not redrawed.
An example can be reproduced as is screens in your public website 1) first set value = 30 2) select and delete value (empty = 0) in gauge text value is correct, but arch remain as 30
Debugging I found that in animate function (row 137), middle is setted as:
var middle = start + previousProgress + displacement * progress;
when value pass from something to 0, displacement is = 0 so middle remain as beforeto avoid it, I add this control before set middle
if (displacement == 0) { displacement = - previousProgress; }
so middle will change correctly