# Need assistance with gauge animation

**URL:** https://discourse.nodered.org/t/need-assistance-with-gauge-animation/45266
**Category:** General
**Created:** [6 May 2021 12:08 UTC](https://discourse.nodered.org/t/need-assistance-with-gauge-animation/45266 "2021-05-06T12:08:01Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![SplitSecComp](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/splitseccomp/32/39802_2.png) [@SplitSecComp](https://discourse.nodered.org/u/SplitSecComp)
#### Post date: [6 May 2021 12:08 UTC](https://discourse.nodered.org/t/need-assistance-with-gauge-animation/45266/1 "2021-05-06T12:08:01Z")

</div>

Hi.

I am running your canvass gauges in Node-Red dashboard in a template node. The gauges display 100% but I am unable to get the animation/needle to work.

Can you kindly help me with an example code on how to get the msg.payload to animate the gauge needle and/or set a variable that can do that.

The following is the HTML code in the example. I need to modify this to work with msg.payload.

var timers = ;

function animateGauges() {  
document.gauges.forEach(function(gauge) {  
timers.push(setInterval(function() {  
gauge.value = Math.random() \*  
(gauge.options.maxValue - gauge.options.minValue) +  
gauge.options.minValue;  
}, gauge.animation.duration + 50));  
});  
}

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [5 July 2021 12:08 UTC](https://discourse.nodered.org/t/need-assistance-with-gauge-animation/45266/2 "2021-07-05T12:08:19Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
