gauge.js
gauge.js copied to clipboard
when the current value is 0
when the current value is 0, the canvas render two pointer,however,there should be one.
this happen when set angle: 0.05 ,it default 0.15
I have the same issue
Gauge has several default values, also this one: Gauge.prototype.displayedValue = 0
When the current value is set to 0, it has the side effect that options are not applied correctly. Quickfix is to set the internal default value Gauge.prototype.displayedValue = 1. Then the display is fine and the textfield is also initialized correctly.
I have commited this quickfix in my fork.
Here is a fiddle to illustrate the situation http://jsfiddle.net/niftytushar/vAnGE/1/ When the value of gauge is set to 0 initially, two pointers are rendered on the canvas. Also no text is displayed in the text field in this situation. However, when we set the value initially to 1 and then to 0 again, then everything works just as expected.
This is the duplicate of #71 and seems to be fixed.