Hello everyone. I'm just using node red a week ago. I can get the data from database to make a line chart but i don't know how to make a chart with multiple type of data taken from database. My flow is below. This is the first time i post so if something wrong please let me know.
P/s: sorry for my bad english and thank for reading my post
[{"id":"66115379.8c654c","type":"inject","z":"eff85edf.d773b","name":"Node 2","topic":"","payload":"","payloadType":"date","repeat":"10","crontab":"","once":true,"onceDelay":0.1,"x":120,"y":260,"wires":[["d4a6fb67.e84f78","2fa0028b.ae6cbe","e7a983c2.03d8a"]]},{"id":"d4a6fb67.e84f78","type":"function","z":"eff85edf.d773b","name":"","func":"msg.topic = \"SELECT datetime,value FROM sensordata WHERE name = 'Temp' AND node = '2'\";\nreturn msg;","outputs":1,"noerr":0,"x":280,"y":260,"wires":[["121ac9a2.1faab6"]]},{"id":"ba57b212.062f1","type":"change","z":"eff85edf.d773b","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"[\t{ \"key\": \"value\", \"values\": msg.payload.[datetime,value] }\t]","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":630,"y":260,"wires":[["78d5f82c.d03618"]]},{"id":"78d5f82c.d03618","type":"ui_chart","z":"eff85edf.d773b","name":"","group":"a8f7387.b3261c8","order":1,"width":"6","height":"3","label":"Nhiệt Độ","chartType":"line","legend":"false","xformat":"auto","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":820,"y":260,"wires":[[]]},{"id":"121ac9a2.1faab6","type":"mysql","z":"eff85edf.d773b","mydb":"b0c7d675.9f98a8","name":"sensordata","x":430,"y":260,"wires":[["ba57b212.062f1"]]},{"id":"2fa0028b.ae6cbe","type":"function","z":"eff85edf.d773b","name":"","func":"msg.topic = \"SELECT datetime,value FROM sensordata WHERE name = 'Air Humidity' AND node = '2'\";\nreturn msg;","outputs":1,"noerr":0,"x":280,"y":320,"wires":[["83e6fc26.08287"]]},{"id":"159a0e51.2c1d42","type":"change","z":"eff85edf.d773b","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"[\t{ \"key\": \"value\", \"values\": msg.payload.[datetime,value] }\t]","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":630,"y":320,"wires":[["84babd7d.7c9eb"]]},{"id":"84babd7d.7c9eb","type":"ui_chart","z":"eff85edf.d773b","name":"","group":"a8f7387.b3261c8","order":2,"width":"6","height":"3","label":"Độ Ẩm Không Khí","chartType":"line","legend":"false","xformat":"auto","interpolate":"linear","nodata":"C","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":850,"y":320,"wires":[[]]},{"id":"83e6fc26.08287","type":"mysql","z":"eff85edf.d773b","mydb":"b0c7d675.9f98a8","name":"sensordata","x":430,"y":320,"wires":[["159a0e51.2c1d42"]]},{"id":"e7a983c2.03d8a","type":"function","z":"eff85edf.d773b","name":"","func":"msg.topic = \"SELECT datetime,value FROM sensordata WHERE name = 'Soil Humidity' AND node = '2'\";\nreturn msg;","outputs":1,"noerr":0,"x":280,"y":380,"wires":[["102e2f46.495be1"]]},{"id":"b73685a7.3c5a28","type":"change","z":"eff85edf.d773b","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"[\t{ \"key\": \"value\", \"values\": msg.payload.[datetime,value] }\t]","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":630,"y":380,"wires":[["5b436ab.507d194"]]},{"id":"5b436ab.507d194","type":"ui_chart","z":"eff85edf.d773b","name":"","group":"a8f7387.b3261c8","order":3,"width":"6","height":"3","label":"Độ Ẩm Đất","chartType":"line","legend":"false","xformat":"auto","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":830,"y":380,"wires":[[]]},{"id":"102e2f46.495be1","type":"mysql","z":"eff85edf.d773b","mydb":"b0c7d675.9f98a8","name":"sensordata","x":430,"y":380,"wires":[["b73685a7.3c5a28"]]},{"id":"a8f7387.b3261c8","type":"ui_group","z":"","name":"Node 2","tab":"e070434f.c4a94","order":2,"disp":true,"width":"6","collapse":false},{"id":"b0c7d675.9f98a8","type":"MySQLdatabase","z":"","host":"127.0.0.1","port":"3306","db":"sensordata","tz":"GMT + 7"},{"id":"e070434f.c4a94","type":"ui_tab","z":"","name":"Biểu đồ","icon":"pie_chart","order":3,"disabled":false,"hidden":false}]