Open sunys99 opened 9 years ago
I just wanted to point out that this happens only when you "initialize" it on 0, not if you use set(0) from the console or otherwise if the gauge has been set to anything > 0 as the first value.
A simple solution for it. Logic is c#, Script is in razor text mode. @{ if (yourItem.CompletionPercentage != 0) { @:var completionPercentage = @yourItem.CompletionPercentage; } else { @:var completionPercentage = 0.1; } @:var gauge = new Gauge(document.getElementById('canvas')).setOptions(opts); // Create gauge @:gauge.maxValue = 100; gauge.animationSpeed = 100; gauge.set(completionPercentage); $('#yourTextDisplay').text(@yourItem.CompletionPercentage + "%");// Set gauge }
The point being use fraction value for plugin and actual value for display.
Yep. Confirm I have this issue too.
At the moment I'm doing
gauge.set(1); gauge.set(0);
When I load my page to work around this.
when I set 0 to gage chart I found 2 guage pointer with angle 0. example: http://jsfiddle.net/niftytushar/vAnGE/1/