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

Class or ID assignment.... #195

Closed vtrufus closed 5 years ago

vtrufus commented 5 years ago

Is there a way to class or id assign the value write in JS for a gauge? I have a gauge and a chart from chartjs on the same page, and they both use "canvas" as the id, so the writes are going to the wrong place.

var gaugeval = ["#showTag11-a"]; var gaugeElement = document.getElementsByTagName('canvas')[0]; gaugeElement.setAttribute('data-value', parseInt($(gaugeval[0]).html()));

vtrufus commented 5 years ago

Nevermind.... It was really late and I did not look closely at the write values example. All is well.