Hi friend,
I want to show my sensor data in a chart, x axis is time and y axis is temperature.
the simplified flow is this :
[{"id":"4b14130c.2a0eec","type":"tab","label":"Chart","disabled":false,"info":""},{"id":"207dfb39.fb8b34","type":"ui_chart","z":"4b14130c.2a0eec","name":"Chart","group":"b5de326a.9358d","order":1,"width":20,"height":7,"label":"chart","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"86400","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":1,"x":610,"y":60,"wires":[[]]},{"id":"34364967.3b9266","type":"inject","z":"4b14130c.2a0eec","name":"Select","topic":"SELECT temp1,time FROM DHT2","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":110,"y":100,"wires":[["45fe79fe.4f9348"]]},{"id":"45fe79fe.4f9348","type":"sqlite","z":"4b14130c.2a0eec","mydb":"4cea1d08.1b70d4","sqlquery":"msg.topic","sql":"","name":"Database","x":260,"y":60,"wires":[["7dc120d8.fd01e"]]},{"id":"7dc120d8.fd01e","type":"function","z":"4b14130c.2a0eec","name":"Fill Chart Array","func":"var chart={};\ndata=msg.payload[0];\nchart.labels = [\"Temperature (˚c)\"];\nchart.series = [''];\nchart.data = [\n [data.temp1],\n [data.time],\n ];\nmsg.payload = [{\n \"series\": [\"A\"],\n \"labels\": [\"temp\"],\n \"data\": [[{\n \"x\": data.time,\n \"y\": data.temp1\n \n }]]\n}]\nreturn {payload:[chart]};","outputs":1,"noerr":0,"x":420,"y":100,"wires":[["207dfb39.fb8b34","8f6c5c9e.bbdec"]]},{"id":"8f6c5c9e.bbdec","type":"debug","z":"4b14130c.2a0eec","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":630,"y":140,"wires":[]},{"id":"b5de326a.9358d","type":"ui_group","z":"","name":"Result","tab":"4ef1815c.0f197","order":2,"disp":true,"width":20,"collapse":false},{"id":"4cea1d08.1b70d4","type":"sqlitedb","z":"","db":"/home/pi/Documents/Sqlite DB/dht2-tbl","mode":"RWC"},{"id":"4ef1815c.0f197","type":"ui_tab","z":"","name":"Chart","icon":"dashboard","order":7,"disabled":false,"hidden":false}]
I see noting in chart ... so what's the problem ?!