How to create a BAR CHART with more than one figures?

I try to create a Bar Chart with two figures. Value1 and Value2. Showing two figures for each day (power IN and power OUT)

Right I tried to do it like that:

var msg1 = {};
var msg2 = {};

msg1.topic =;
msg2.topic =;

msg1.payload = parseFloat(msg.payload.pwr_IN);
msg2.payload = parseFloat(msg.payload.pwr_OUT);

return [msg1,msg2];

Unfortunately msg2 overwrites the figures from msg1 and all I get is a one-figure bar chart, showing msg2-values only.

Any idea what I am doing wrong ?


your current return sends individual messages (if set for 1 output), the 1st is replaced by the 2nd (see the docs)

For multiple bars in a chart, the built in help (on the sidebar) has a link to online documentation detailing the required format for multiple bars in bar charts.

Maybe change the topic by adding “in” and “out” so they are different to each other

ok, this looks exactly how the solution I am looking for

unfortunately I have no idea how to realize it in Node Red Code :frowning:

On the input side I have a SQL Query, that gives me 14 Lines with 3 columns each. Not I would like to transfort this into a bar chart with 14 bars with 3 stacks each. Is that possible ?
My Input looks like this:


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.