# Different colors in a dashboard chart widget, with two sliders as input

**URL:** https://discourse.nodered.org/t/different-colors-in-a-dashboard-chart-widget-with-two-sliders-as-input/84707
**Category:** Dashboard
**Created:** [19 January 2024 02:11 UTC](https://discourse.nodered.org/t/different-colors-in-a-dashboard-chart-widget-with-two-sliders-as-input/84707 "2024-01-19T02:11:48Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![Dutchdoc](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dutchdoc/32/87250_2.png) [@Dutchdoc](https://discourse.nodered.org/u/Dutchdoc)
#### Post date: [19 January 2024 02:11 UTC](https://discourse.nodered.org/t/different-colors-in-a-dashboard-chart-widget-with-two-sliders-as-input/84707/1 "2024-01-19T02:11:48Z")

</div>

Beginner's question: different colors in a dashboard chart widget.

Just for (self-)educational purposes, I tied two dashboard slider widgets to one chart widget.  
This works fine (even though it has no practical value: I realize that).  
The reason I did this was to test the chart's ability to (according to its help info) display two different color lines, based on different received topics. (I actually had this working (two different colors in one chart) with two MQTT widgets tied to one chart, so I know the chart can handle it.).

For some reason, I can't get the 'two color' thing to work with two sliders each with a different topic: the problem I see is that while a slider has a 'Topic' field, it never seems to send a topic in its msg object (according to a debug widget): only payload, socketid, and \_msgid.

I tried, in the Topic field the following: msg.series1, msg.topic.series1, and msg.topic=series1, but it never sends a msg.topic member.

What can I do to make this work?

Thanks in advance!

---

<div class="post-metadata">

### Author: ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)
#### Post date: [19 January 2024 03:17 UTC](https://discourse.nodered.org/t/different-colors-in-a-dashboard-chart-widget-with-two-sliders-as-input/84707/2 "2024-01-19T03:17:20Z")

</div>

Looks like a bug to me.

Edit: No it doesn't! Deleted post.

---

<div class="post-metadata">

### Author: ![Dutchdoc](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dutchdoc/32/87250_2.png) [@Dutchdoc](https://discourse.nodered.org/u/Dutchdoc)
#### Post date: [19 January 2024 04:03 UTC](https://discourse.nodered.org/t/different-colors-in-a-dashboard-chart-widget-with-two-sliders-as-input/84707/3 "2024-01-19T04:03:49Z")

</div>

Your suggestion made me try to simply "change" the msg (even though you mentioned of just doing that wouldn't work), like this:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/8/b8c632fddc9c868e1372c9ac1e6eb5e026a8ed08.png)

And now I DO indeed get two colors ... but now the chart behaves weird, in fact I sometimes see a third color (orange)! I may have to play with the chart settings a bit. After all the debug messages look like what I think they should be!

Update: Actually, it now works fine! The weird behavior (and 3rd color) were an artifact of the chart retaining 'old' data. So the above (inserting a 'change' widget) does what I was looking for!

---

<div class="post-metadata">

### Author: ![juntiedt](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/juntiedt/32/58357_2.png) [@juntiedt](https://discourse.nodered.org/u/juntiedt)
#### Post date: [19 January 2024 09:20 UTC](https://discourse.nodered.org/t/different-colors-in-a-dashboard-chart-widget-with-two-sliders-as-input/84707/4 "2024-01-19T09:20:14Z")

</div>

have a look at this post:

> [@Zigbee2mqtt Aquara triple Sensors WSDCGQ11LM (temp, humidity, pressure) - 2 sensor test-flow](https://discourse.nodered.org/t/zigbee2mqtt-aquara-triple-sensors-wsdcgq11lm-temp-humidity-pressure-2-sensor-test-flow/84511/2):
>
> I have added min-max values to the flow which is very usefull in sensor use cases. Reset of min max is set to occur on midnight. Can be changed to week etc. [Zigbee-14.01.2024.txt](https://discourse.nodered.org/uploads/short-url/30VxRGDULLwK0kYHy4jgQbUhzPz.txt) (140.2 KB) Flow updated sunday 14.01.2024 at 10:50

---

<div class="post-metadata">

### Author: ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)
#### Post date: [19 January 2024 10:40 UTC](https://discourse.nodered.org/t/different-colors-in-a-dashboard-chart-widget-with-two-sliders-as-input/84707/5 "2024-01-19T10:40:26Z")

</div>

It never occurred to me to set msg.topic after the sliders!

I was focussed on the strange misbehaviour of the slider node.

---

<div class="post-metadata">

### Author: ![Sean-McG](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sean-mcg/32/54677_2.png) [@Sean-McG](https://discourse.nodered.org/u/Sean-McG)
#### Post date: [19 January 2024 10:51 UTC](https://discourse.nodered.org/t/different-colors-in-a-dashboard-chart-widget-with-two-sliders-as-input/84707/6 "2024-01-19T10:51:06Z")

</div>

Are you sure the topic is setup correctly as it works fine for me ?

Note topic should be set to text(az) the default is msg and needs to be changed.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/c/accacb563a35828d0e98ac4045884d8495d78352.png)

---

<div class="post-metadata">

### Author: ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)
#### Post date: [19 January 2024 11:12 UTC](https://discourse.nodered.org/t/different-colors-in-a-dashboard-chart-widget-with-two-sliders-as-input/84707/7 "2024-01-19T11:12:33Z")

</div>

Last night I'm sure it was ignoring flow/global context values but I can't replicate that now.

The work-around above shows all the symptoms of being a product of 3am insomnia ie it's rubbish!

---

<div class="post-metadata">

### Author: ![Dutchdoc](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dutchdoc/32/87250_2.png) [@Dutchdoc](https://discourse.nodered.org/u/Dutchdoc)
#### Post date: [19 January 2024 17:39 UTC](https://discourse.nodered.org/t/different-colors-in-a-dashboard-chart-widget-with-two-sliders-as-input/84707/8 "2024-01-19T17:39:05Z")

</div>

> Note topic should be set to text(az) the default is msg and needs to be changed.

THAT was it!  
I had tried with Topic: msg. msg.topic. and msg.topic = , but it never occurred to me to just use a string!

Thanks!

---

<div class="post-metadata">

### Author: ![Sean-McG](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sean-mcg/32/54677_2.png) [@Sean-McG](https://discourse.nodered.org/u/Sean-McG)
#### Post date: [19 January 2024 17:47 UTC](https://discourse.nodered.org/t/different-colors-in-a-dashboard-chart-widget-with-two-sliders-as-input/84707/9 "2024-01-19T17:47:22Z")

</div>

No problem.

The other options, such as msg.(someProperty) are there so the topic can be provided dynamically.

---

<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: [2 February 2024 17:48 UTC](https://discourse.nodered.org/t/different-colors-in-a-dashboard-chart-widget-with-two-sliders-as-input/84707/10 "2024-02-02T17:48:03Z")

</div>

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