Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zero value is not drawed correctly in some case #68

Open
ghost opened this issue Jul 5, 2019 · 0 comments
Open

Zero value is not drawed correctly in some case #68

ghost opened this issue Jul 5, 2019 · 0 comments

Comments

@ghost
Copy link

ghost commented Jul 5, 2019

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

Screenshot 2019-07-05 at 11 32 05
Screenshot 2019-07-05 at 11 32 12

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants