I am trying to build a chart with some data from mysql database.
I have a query to the database and it returns a object with temperatures that I want to send to a chart and make a line chart. So that I can see the change of temperature through the last 30 days.
This is the output of the query:
I receive the month and the respective average temperature. Ou is it possible to put it in a line chart?
It should certainly be possible. The help info in the ui_chart node signposts you to the correct data formatting. I don't use it often enough to remember off the top of my head.
The UI charts, at least the line chart, generally anticipates that the X axis will be JavaScript date/time values I think? So you may have to pass an additional parameter to change to your simple month number - though don't take that as gospel, again the help info should give you the right format.
in the x axis theres some timestamp, and I wanted the month and in the y axis I don't know where it is found. I found that guide not very well explained, could have at least a graphical example.
But that is the chart I am getting and the flow is this:
I know it is confusing but, I used those change flows to get the average from the object, there's the average of each month and then join them in an array that I use in the function and send to the chart
The label and topic flows I got from the example, but I don't understand how they work.