bernii / gauge.js

100% native and cool looking JavaScript gauge
MIT License
1.42k stars 391 forks source link

v1.3.1 min value shows broken chart #116

Closed ktsaou closed 7 years ago

ktsaou commented 7 years ago

If the value requested is the minimum value, this is what happens:

image

As a work around I just added 0.001 to the minimum value to have the chart rendered properly.

kplindegaard commented 7 years ago

The problem with minValue and first rendering, i.e. gauge.set( minValue ) has been there quite a while. @johanye's new option 'limitMin comes to the rescue, so you may want to try enable that.

var opt = { // your other options limitMin: true };

gauge.setOptions(opt); gauge.set(0);

I think that should sufficient in your case as an alternative workaround. But you do have a point, there is something fishy there.

ktsaou commented 7 years ago

@kplindegaard thanks!

I already have limitMin: true. This issue appears with that in place: https://github.com/firehol/netdata/pull/1725/files

kplindegaard commented 7 years ago

@ktsaou You are right! What a bummer... I am forcing an update when you do the first .set() operation now in the latest commit. I hope that should pull it off. Do mind testing again with the latest commit, please?

ktsaou commented 7 years ago

tested 1.3.2 - it works nicely.

ktsaou commented 7 years ago

thank you!