Read Thingspeak API and plot chart

Trying to plot a line chart after reading from Thingspeak but empty chart appears on UI and no line drawn

[{"id":"da03e7c2.9473b8","type":"tab","label":"Test","disabled":false,"info":""},{"id":"fa13b94f.299688","type":"ui_chart","z":"da03e7c2.9473b8","name":"","group":"69e20d86.02f0b4","order":0,"width":0,"height":0,"label":"{{msg.labels}}","chartType":"line","legend":"true","xformat":"HH:mm:ss","interpolate":"step","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":"1","removeOlderPoints":"10","removeOlderUnit":"86400","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":1,"x":830,"y":200,"wires":[[]]},{"id":"7322c3e5.c2a95c","type":"inject","z":"da03e7c2.9473b8","name":"","topic":"","payload":"[]","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":630,"y":200,"wires":[["fa13b94f.299688"]]},{"id":"dc2f0acc.3f7c68","type":"change","z":"da03e7c2.9473b8","name":"Data Array","rules":[{"t":"set","p":"object","pt":"msg","to":"{\t       \"series\": [\"field1\"],\t       \"labels\": [\"field1\"],\t       \"data\": $$.feeds[\t           {\t               \"x\": created_at,\t               \"y\": $number(field1)\t            }\t       ]\t}\t","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":450,"y":120,"wires":[["751a5d3b.418da4"]]},{"id":"751a5d3b.418da4","type":"function","z":"da03e7c2.9473b8","name":"Setup payload","func":"series = [];\ndata = [];\nlabels = [];\n\nseries.push(\"field1\");\nlabels.push(\"field1\");\ndata.push(msg.payload.feeds);\n\nmsg.payload = [{\"series\":series, \"data\":data,\"labels\": labels}];\nmsg.topic = \"Temperature\"\nreturn msg;","outputs":1,"noerr":0,"x":640,"y":80,"wires":[["fa13b94f.299688","b60c6649.491818"]]},{"id":"1715c693.e95969","type":"inject","z":"da03e7c2.9473b8","name":"Trigger","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":true,"onceDelay":0.1,"x":120,"y":140,"wires":[["3dc0c4fc.6fcb0c"]]},{"id":"b60c6649.491818","type":"debug","z":"da03e7c2.9473b8","name":"function","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":880,"y":80,"wires":[]},{"id":"3dc0c4fc.6fcb0c","type":"http request","z":"da03e7c2.9473b8","name":"","method":"GET","ret":"obj","paytoqs":false,"url":"https://api.thingspeak.com/channels/965236/fields/1.json?results=5","tls":"","persist":false,"proxy":"","authType":"","x":270,"y":140,"wires":[["dc2f0acc.3f7c68","3fe9807e.24129"]]},{"id":"3fe9807e.24129","type":"debug","z":"da03e7c2.9473b8","name":"json debug","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":600,"y":300,"wires":[]},{"id":"69e20d86.02f0b4","type":"ui_group","z":"","name":"Group 1","tab":"ad496fac.19c7e","order":1,"disp":true,"width":"12","collapse":false},{"id":"ad496fac.19c7e","type":"ui_tab","z":"","name":"Tab1","icon":"dashboard"}]

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