It works!
After a few sleepless nights, I succeeded!
It takes a query that returns x and y:
SELECT "time" AS "x", value AS y FROM volt WHERE time > now() - 6h;
then the function node to correctly format the array:
var chart1 = [{"series": ["A"],
"data": [
msg.payload
],
"labels": [""]
}];
msg.payload = chart1;
return msg;
After a few sleepless nights, I succeeded!
It takes a query that returns x and y:
SELECT "time" AS "x", value AS y FROM volt WHERE time > now() - 6h;
then the function node to correctly format the array:
var chart1 = [{"series": ["A"],
"data": [
msg.payload
],
"labels": [""]
}];
msg.payload = chart1;
return msg;