Hi, I'm new to Node Red so please try to bare with me.
I'm running it on a raspberry pi 3 with a postgresql database on the same device. I have no issue pulling the data from the database but for some reason I can not get the data plotted. I've formatted the data as best as possible but still cant get anywhere. I've read a lot about the chart input format and think I have it correct but still not working. I've even done a simple random generator to chart input, put a debug on the output of the chart and tried to copy the exact same format but still cant get my chart to work.
I was originally working with several days worth of data, then thought it was too much so cut it down to just 10 points but still no joy. I've copied the payload from the database output and put it into this dummy flow to try and test the charting and to share a flow with you guys. I'm sure it's something very very simple going wrong but for the life of me can't figure it out. I've been working this for 2 days solid now so really would love some help.
[{"id":"3921690.72a5598","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"6755d009.c977","type":"ui_chart","z":"3921690.72a5598","name":"test data","group":"7a4ca97c.7b0a78","order":2,"width":0,"height":0,"label":"test data","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":1,"x":793,"y":140,"wires":[[]]},{"id":"7f104c38.306144","type":"inject","z":"3921690.72a5598","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":189,"y":137,"wires":[["f86347c0.554c38"]]},{"id":"f86347c0.554c38","type":"function","z":"3921690.72a5598","name":"test data","func":"msg.payload = [{\"room\":\"CharliesBedroom\",\"datetime\":\"2019-12-04T19:08:41.587Z\",\"value\":\"20.81\"},{\"room\":\"CharliesBedroom\",\"datetime\":\"2019-12-04T19:04:09.702Z\",\"value\":\"20.63\"},{\"room\":\"CharliesBedroom\",\"datetime\":\"2019-12-04T11:15:11.764Z\",\"value\":\"21.25\"},{\"room\":\"CharliesBedroom\",\"datetime\":\"2019-12-04T11:14:11.766Z\",\"value\":\"21.31\"},{\"room\":\"CharliesBedroom\",\"datetime\":\"2019-12-04T11:13:12.647Z\",\"value\":\"21.44\"},{\"room\":\"CharliesBedroom\",\"datetime\":\"2019-12-04T11:12:11.755Z\",\"value\":\"21.31\"},{\"room\":\"CharliesBedroom\",\"datetime\":\"2019-12-04T11:11:11.760Z\",\"value\":\"21.44\"},{\"room\":\"CharliesBedroom\",\"datetime\":\"2019-12-04T11:10:11.766Z\",\"value\":\"21.38\"},{\"room\":\"CharliesBedroom\",\"datetime\":\"2019-12-04T11:09:12.647Z\",\"value\":\"21.31\"},{\"room\":\"CharliesBedroom\",\"datetime\":\"2019-12-04T11:08:11.777Z\",\"value\":\"21.19\"}];\nmsg.topic = \"CharliesBedroom\";\nreturn msg;","outputs":1,"noerr":0,"x":364,"y":141,"wires":[["4c921398.7625ac","42a4f62.b258608"]]},{"id":"4c921398.7625ac","type":"debug","z":"3921690.72a5598","name":"test data","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":570,"y":224,"wires":[]},{"id":"42a4f62.b258608","type":"change","z":"3921690.72a5598","name":"Format data","rules":[{"t":"set","p":"payload","pt":"msg","to":"(\t $series := [\t { \"field\": \"value\", \"label\": \"CharliesRoom\" }\t ];\t $xaxis := \"datetime\";\t [\t {\t \"series\": [$series.label],\t \"data\": $series.[\t (\t $yaxis := $.field;\t $$.payload.{\t \"x\": $toMillis($string(($lookup($, $xaxis)))),\t \"y\": $number($lookup($, $yaxis))\t }\t )\t ],\t \"labels\": [\"\"]\t }\t ]\t)","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":574.5,"y":137,"wires":[["de5f412d.f013c","6755d009.c977"]]},{"id":"de5f412d.f013c","type":"debug","z":"3921690.72a5598","name":"test data output","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":789,"y":225,"wires":[]},{"id":"7a4ca97c.7b0a78","type":"ui_group","name":"Group 1","tab":"b82fb60e.f8a9e8","order":1,"disp":true,"width":6},{"id":"b82fb60e.f8a9e8","type":"ui_tab","name":"Tab 1","icon":"dashboard","order":1}]