Just to provide a cleaner (Dashboard 2.0) approach to this, no need to have multiple arrays/structures:
var i = 0;
var data = []
while (i < 360) {
data.push({
label: i,
"Axe X": msg.payload.data.x_axis.axis_data[(i)],
"Axe Y": msg.payload.data.y_axis.axis_data[(i)],
"Axe Z": msg.payload.data.z_axis.axis_data[(i)],
})
i++;
}
msg.payload = data
return msg;
Then, on the ui-chart
node, define the x
key
as label
, then the "Series" property can be "JSON", and you can provide an array of strings here ["Axe X", "Axe Y", "Axe Z"]
, then it will draw the three lines for you