# Is it possible to add gauges dynamically with node-red-dashboard?

**URL:** https://discourse.nodered.org/t/is-it-possible-to-add-gauges-dynamically-with-node-red-dashboard/61359
**Category:** General
**Created:** [16 April 2022 06:19 UTC](https://discourse.nodered.org/t/is-it-possible-to-add-gauges-dynamically-with-node-red-dashboard/61359 "2022-04-16T06:19:37Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![raylight](https://avatars.discourse-cdn.com/v4/letter/r/cdc98d/32.png) [@raylight](https://discourse.nodered.org/u/raylight)
#### Post date: [16 April 2022 06:19 UTC](https://discourse.nodered.org/t/is-it-possible-to-add-gauges-dynamically-with-node-red-dashboard/61359/1 "2022-04-16T06:19:37Z")

</div>

I'd like to create multiple gauges with the node-red-dashboard in a dynamic way. Let's say I have this dashboard:

 ![Screenshot_20220416_032117](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/0/607160da383f1d7ba6477c1ff0c96929ef992c12.png)

It was created by manually setting each gauge as the following:

![Screenshot_20220416_030905](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/9/494e700533f939c336cbbbfd7eca00c7c494ad28.png)

But let's say I have the following JSON:

```auto
[
  {
    "topic": "name1",
    "payload": 10
  },
  {
    "topic": "name2",
    "payload": 5
  },
  {
    "topic": "name3",
    "payload": 6
  },
  {
    "topic": "name4",
    "payload": 7
  },
  {
    "topic": "name5",
    "payload": 4
  },
  {
    "topic": "name6",
    "payload": 10
  },
  {
    "topic": "name7",
    "payload": 9
  },
]

```

Let's also say that this JSON is dynamic and it can have a vector with different lengths. In this example, its length is 7 but in my case, it could reach more than 50 while also having the possibility of increasing its length from time to time. Is it possible to draw a flow where I don't need to manually insert 50 gauges instances in it? Something like sending separated messages to a single gauge and it manages to draw the dashboard with different gauges?

I haven't found anything related to this kind of functionality in its documentation... Can I do it by mixing it with other dashboard nodes?

I can generate this JSON dynamically from time to time. I could use a function node to loop in it and use the `node.send()` function to separate the messages. The problem is that if I do it in a single gauge node I'll see changes only in a single gauge in my dashboard.

---

<div class="post-metadata">

### Author: ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)
#### Post date: [16 April 2022 06:39 UTC](https://discourse.nodered.org/t/is-it-possible-to-add-gauges-dynamically-with-node-red-dashboard/61359/2 "2022-04-16T06:39:05Z")

</div>

It is possible with ui-template and JS . Here is a link to proof of concept [How to break data array into separate charts with data and labels - #6 by E1cid](https://discourse.nodered.org/t/how-to-break-data-array-into-separate-charts-with-data-and-labels/39516/6)

---

<div class="post-metadata">

### Author: ![raylight](https://avatars.discourse-cdn.com/v4/letter/r/cdc98d/32.png) [@raylight](https://discourse.nodered.org/u/raylight)
#### Post date: [16 April 2022 06:45 UTC](https://discourse.nodered.org/t/is-it-possible-to-add-gauges-dynamically-with-node-red-dashboard/61359/3 "2022-04-16T06:45:28Z")

</div>

Cool... in this case, I'd still have to use the gauge node? Or would it be only the ui-template node and js?

---

<div class="post-metadata">

### Author: ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)
#### Post date: [16 April 2022 06:46 UTC](https://discourse.nodered.org/t/is-it-possible-to-add-gauges-dynamically-with-node-red-dashboard/61359/4 "2022-04-16T06:46:27Z")

</div>

Check the flow i linked to, no ui-gauge node required.

---

<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: [15 June 2022 06:46 UTC](https://discourse.nodered.org/t/is-it-possible-to-add-gauges-dynamically-with-node-red-dashboard/61359/5 "2022-06-15T06:46:44Z")

</div>

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