Multiple line graph using only MQTT Values

Hi here,
i m a newbe in Nodered so sorry if my question seems dummy.
I am trying to build a graph from only the values ​​coming from my MQTT Topic.
it must be a multiline graph.

from my MQTT, I get the timestamp supposed to be represented on my x-axis, and some values ​​x, y, z, r and ö which are the different lines of my graphs.

my concerns are therefore the following.

  • how to use timestamp from my topic
    -how to draw the different lines on the same graph and set their value to 0 in case I do not receive data at a certain time t


for now, here's a snippet of code that I'm trying to implement

msg.timestamp=msg.payload.test_ts; //use the time content in my topic

var x={};
var y={};
var z={};
var r={};
var o={};

//var x=0;
//var y=0;
//var z=0;
//var r=0;
//var o=0;

x.payload = msg.payload.test_ax;

y.payload = msg.payload.test_ay;

z.payload = msg.payload.test_az;

r.payload = msg.payload.test_rx;

o.payload = msg.payload.test_rz;


also when i m checking the debugging file, i m getting only one value, don t know why

The chart node has valuable information in the information panel, which links here.

1 Like