Hi,
I 'm trying to plot a Graph from Sqlite3 data, so far so good.
This is working:
var dataout = [];
var a1 = [];
var payload = msg.payload
for (let i = 0; i < payload.length; i++)
{
--->>> var yy = payload[i].powerdc
var temp1 = { "x": i, "y": yy }
a1.push(temp1);
}
dataout = [ a1 ];
msg.payload = [{
"series": [ "A" ],
"data": dataout,
"labels": ["B"]
}];
msg.topic = null
return msg;
This not:
var dataout = [];
var a1 = [];
var payload = msg.payload
for (let i = 0; i < payload.length; i++)
{
--->> var temp1 = { "x": i, "y": payload[i].powerdc }
a1.push(temp1);
}
dataout = [ a1 ];
msg.payload = [{
"series": [ "A" ],
"data": dataout,
"labels": ["B"]
}];
msg.topic = null
return msg;
does somebody knows the answer, thank you in advance.
r/Detlef