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

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

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

Screenshot_20220416_030905

But let's say I have the following JSON:

[
  {
    "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.

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

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

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

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