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.
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()));
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()));