MySQL SELECT to Line Chart

Hi guys,
I need some help please.
I have an output like this from mysql database.
outputMysql
And i want to do a line chart with values about "velocidade" for example.
Anyone can give me some help to do that?

Thanks :slight_smile:

Try a function node:

m = msg.payload

chart = []

for(x=0;x<m.length;x++){
    chart.push([m[x].temperatura,m[x].velocidade])

}

out = [
    {
        "series":["x","y"],
        "data":chart,
        "labels":[""]
    }
]
    
return {payload:out}

Connect it to the chart.

The chart stay empty.

It does not if you provide the proper output data.

Is it a msg or a msg.payload ?
if it is msg change the function to m = msg