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

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!

Looks like a bug to me.

Edit: No it doesn't! Deleted post.

1 Like

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

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!

1 Like

have a look at this post:

1 Like

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

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

1 Like

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.

1 Like

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!

1 Like

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!

No problem.

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

1 Like

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