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

**URL:** <https://discourse.nodered.org/t/how-to-create-a-bar-chart-with-more-than-one-figures/40626>\
**Category:** Dashboard\
**Created:** [8 February 2021 20:04 UTC](https://discourse.nodered.org/t/how-to-create-a-bar-chart-with-more-than-one-figures/40626 "2021-02-08T20:04:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gawan](https://avatars.discourse-cdn.com/v4/letter/g/e9c0ed/32.png) [@Gawan](https://discourse.nodered.org/u/Gawan)\
**Post date:** [8 February 2021 20:04 UTC](https://discourse.nodered.org/t/how-to-create-a-bar-chart-with-more-than-one-figures/40626/1 "2021-02-08T20:04:58Z")

</div>

Hi,  
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:

```auto
var msg1 = {};
var msg2 = {};

msg1.topic = msg.payload.date;
msg2.topic = msg.payload.date;

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 ?

BR  
G

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [8 February 2021 20:20 UTC](https://discourse.nodered.org/t/how-to-create-a-bar-chart-with-more-than-one-figures/40626/2 "2021-02-08T20:20:07Z")

</div>

your current return sends individual messages (if set for 1 output), the 1st is replaced by the 2nd (see the [docs](https://nodered.org/docs/user-guide/writing-functions#multiple-outputs))

For multiple bars in a chart, the built in help (on the sidebar) has a link to online [documentation](https://github.com/node-red/node-red-dashboard/blob/master/Charts.md#bar-and-pie-charts) detailing the required format for multiple bars in bar charts.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [8 February 2021 20:56 UTC](https://discourse.nodered.org/t/how-to-create-a-bar-chart-with-more-than-one-figures/40626/3 "2021-02-08T20:56:08Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Gawan](https://avatars.discourse-cdn.com/v4/letter/g/e9c0ed/32.png) [@Gawan](https://discourse.nodered.org/u/Gawan)\
**Post date:** [28 February 2021 20:05 UTC](https://discourse.nodered.org/t/how-to-create-a-bar-chart-with-more-than-one-figures/40626/4 "2021-02-28T20:05:18Z")

</div>

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

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

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:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/8/c8cda151a1c990ee5a8ba3e1ca9fb673dd049bf6.png)

BR  
G

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [30 March 2021 20:05 UTC](https://discourse.nodered.org/t/how-to-create-a-bar-chart-with-more-than-one-figures/40626/5 "2021-03-30T20:05:51Z")

</div>

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