Mikhus / canvas-gauges

HTML5 Canvas Gauge. Tiny implementation of highly configurable gauge using pure JavaScript and HTML5 canvas. No dependencies. Suitable for IoT devices because of minimum code base.
http://canvas-gauges.com/
MIT License
1.57k stars 396 forks source link

Gauge shows value of longer animated value, after shorter animation #134

Open mainstreetmark opened 7 years ago

mainstreetmark commented 7 years ago

Here's a fiddle for you.

https://jsfiddle.net/m6x9L2mk/4/

I update the Gauge on that screen so it animates up to 15, over the course of 10 seconds.

1 second into the animation, I animate it to 60, over 2 seconds. The needle swings up to 60 in 2 seconds, and jumps to 15.

mainstreetmark commented 7 years ago

Oh, and I had to add id="canvas-id" to the to make your zero-conf gauge examples work.

mainstreetmark commented 7 years ago

This seems to be related to my previous bug #94.

mainstreetmark commented 7 years ago

https://jsfiddle.net/m6x9L2mk/5/

I fixed the behavior by manually deleting gauge._value before setting the new one.

Mikhus commented 7 years ago

I need to investigate this first... but have a lack of time for the moment...

ptorrent commented 6 years ago

Thanks @mainstreetmark it solve my problem too.