Chart help please.

93 views
Skip to first unread message

shykitten55

unread,
May 23, 2018, 1:49:52 AM5/23/18
to Node-RED
Setting up a Chart is fairly easy.

I have most of what I want to happen happening, but I'm wondering if this is possible:

In the graph's settings there is a field which you enter text, and before any data arrives, this text is shown.

This is handy for THE first time before data arrives to see that is true.

But subsequent attempts fail to get that text back.


Is there a way that if/when data stops arriving, a message (text) can be shown as per the afore mentioned?

I've tried setting the field to {{msg.topic}} and sending a packet with the msg.topic = "TEST" and nothing happens.


Thanks in advance.

shykitten55

unread,
May 23, 2018, 1:52:07 AM5/23/18
to Node-RED
(sorry, should have posted this with the original post)

This is the example flow - which doesn't work.


[{"id":"5c230b5a.cb1d74","type":"debug","z":"2d44537.f26082c","name":"Topic","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"topic","x":500,"y":930,"wires":[]},{"id":"fc7d360c.71206","type":"function","z":"2d44537.f26082c","name":"","func":"msg.topic = \"No Comms\";\nreturn msg;","outputs":1,"noerr":0,"x":360,"y":890,"wires":[["551f28b2.981e9","5c230b5a.cb1d74","6e7816b7.6e8ad"]]},{"id":"5e830479.30b914","type":"inject","z":"2d44537.f26082c","name":"","topic":"","payload":"0","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":190,"y":890,"wires":[["fc7d360c.71206"]]}]

Dave C-J

unread,
May 23, 2018, 9:49:28 AM5/23/18
to node...@googlegroups.com
the text it there when there is no data... so to get back to no data you need to send a payload containing and empty array    
    msg.payload = [];

shykitten55

unread,
May 23, 2018, 6:09:49 PM5/23/18
to Node-RED
Thanks.

Honestly I don't know why, but I tried that and it "didn't work" but now when I tried it after you said it:  it worked.

Go figure.
Reply all
Reply to author
Forward
0 new messages