Shred Payload and make a graph

How can I extract the subheadings in the message and make a graphic? The sub message I want to create a graphic is in the visual.

What sort of graphic so you want? If you mean a line graph then the help text for the dashboard chart has a link to how to fill the chart with historical data.

Yes line chart. But shouldn't it be necessary to extract other information from the incoming message?

Hello,
did you read the documentation? In the part about working with messages it tells you how to change and move message properties and it helps you understand message structures:

https://nodered.org/docs/user-guide/messages

Johannes

In the UI chart built in help is a link to documentation that explains the required format for displaying data on the chart. Have you seen/read this?

Here is a solution that works for most arrays of objects...

With very little changes, you could adapt this.

For this simple use case I would just split the array and then reformat each point into a value and timestamp and send as if they were dynamic data..

eg

[{"id":"827f6e64.6e8d4","type":"inject","z":"847a21f.bae23e","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"[{\"sicaklik\":24,\"tarih\":\"2021-04-16T15:55:22.1532\"},{\"sicaklik\":23,\"tarih\":\"2021-04-16T16:05:22.1532\"}]","payloadType":"json","x":130,"y":1060,"wires":[["a746c796.79d758"]]},{"id":"a746c796.79d758","type":"split","z":"847a21f.bae23e","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":270,"y":1060,"wires":[["26f7ecdc.a15c14"]]},{"id":"48dd2222.cb7e8c","type":"ui_chart","z":"847a21f.bae23e","name":"","group":"76c7ecce.17e474","order":0,"width":0,"height":0,"label":"chart","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"x":630,"y":1060,"wires":[[]]},{"id":"26f7ecdc.a15c14","type":"change","z":"847a21f.bae23e","name":"","rules":[{"t":"move","p":"payload.tarih","pt":"msg","to":"timestamp","tot":"msg"},{"t":"move","p":"payload.sicaklik","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":440,"y":1060,"wires":[["48dd2222.cb7e8c"]]},{"id":"76c7ecce.17e474","type":"ui_group","name":"Default","tab":"1dd0150e.a0583b","order":1,"disp":true,"width":"6","collapse":false},{"id":"1dd0150e.a0583b","type":"ui_tab","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]

1 Like

The beauty of node-red :clap:

Thank you for a quick solution.

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