MYSQL database to chart

Hi everyone,

I'm tryign to make a chart with the data in a mysql database. The database name is "prueba" and the table name is "prueba" too. When I deploy the flow the chart is blank and I don't know whats wrong.

This is the flow:
[{"id":"42ac8bd2.5ce6d4","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"a65cd334.88fbc","type":"mysql","z":"42ac8bd2.5ce6d4","mydb":"6b117fd6.12162","name":"","x":300,"y":200,"wires":[["93262868.006e78"]]},{"id":"f05703c7.1631c","type":"ui_chart","z":"42ac8bd2.5ce6d4","name":"","group":"ca30b7ae.d36008","order":1,"width":0,"height":0,"label":"chart","chartType":"line","legend":"false","xformat":"auto","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"604800","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"x":550,"y":200,"wires":[["e2ec0bee.b98938"]]},{"id":"e2ec0bee.b98938","type":"debug","z":"42ac8bd2.5ce6d4","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":730,"y":140,"wires":[]},{"id":"93262868.006e78","type":"change","z":"42ac8bd2.5ce6d4","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"[ { \"key\": \"AMB_T\", \"values\": msg.payload.[epoch, AMB_T] } ]","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":430,"y":140,"wires":[["f05703c7.1631c"]]},{"id":"bab911cb.28d1b","type":"inject","z":"42ac8bd2.5ce6d4","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"select * from prueba","payload":"","payloadType":"date","x":130,"y":180,"wires":[["a65cd334.88fbc"]]},{"id":"6b117fd6.12162","type":"MySQLdatabase","name":"","host":"127.0.0.1","port":"3306","db":"prueba","tz":"","charset":"UTF8"},{"id":"ca30b7ae.d36008","type":"ui_group","name":"Informe","tab":"e69e034.ca863","order":1,"disp":true,"width":"6","collapse":false},{"id":"e69e034.ca863","type":"ui_tab","name":"Grafico","icon":"dashboard","disabled":false,"hidden":false}]

I will Include also a photo of the database. I want to make a line chart with the values in AMB_T column.

Welcome to the forum @victorramos99

In order to make code more readable and importable it is important to surround your code with three backticks
```
like this
```

You can edit and correct your post by clicking the pencil icon.

See this post for more details - How to share code or flow json

Feed the data that you are giving to the database into a debug node and compare it with the required format described in node-red-dashboard/Charts.md at master · node-red/node-red-dashboard · GitHub

If you are a complete beginner with node-red then I recommend watching this playlist: Node-RED Essentials. The videos are done by the developers of node-red. They're nice & short and to the point. You will understand a whole lot more in about 1 hour. A small investment for a lot of gain.

If you search the forum for the title of your question it will find a number of hits that may be helpful.

If you are still stuck after that then come back and tell us which bit you have having difficulty with.

I have compared my data with the required format that shows in the links and I could solve the problem.

Thank you for your time Colin! :slight_smile:

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