# Problem with filling data to bar chart

**URL:** https://discourse.nodered.org/t/problem-with-filling-data-to-bar-chart/23553
**Category:** Dashboard
**Created:** [24 March 2020 11:19 UTC](https://discourse.nodered.org/t/problem-with-filling-data-to-bar-chart/23553 "2020-03-24T11:19:18Z")
**Posts on this page:** 3
**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: [24 March 2020 11:19 UTC](https://discourse.nodered.org/t/problem-with-filling-data-to-bar-chart/23553/1 "2020-03-24T11:19:18Z")

</div>

Hi,

I have 200 values in a database I want to show in a chart.  
As the data is on a daily base, I would prefer to use a bar chart.

BUT ... when I fill the data into a line chart it looks perfectly fine and I get one value per day. When I fill it into a bar chart all I get is one bar with the latest value. The whole time information is lost.

I transfer the data this way:

```auto

msg.topic = "TimeLineBarChart";
msg.timestamp = parseInt(msg.payload.Timeseries);
msg.payload = parseFloat(msg.payload.Value);

return msg;

```

and in the database it looks like this:

```auto
Timeseries Timestamp Parameter Value
1577923200000	2020-01-02 00:00:00.000	Energy_Daily_Sum 2.66
1578009600000	2020-01-03 00:00:00.000	Energy_Daily_Sum 2.05
1578096000000	2020-01-04 00:00:00.000	Energy_Daily_Sum 0.28
1578182400000	2020-01-05 00:00:00.000	Energy_Daily_Sum 0.67

```

Any idea what I have to do to get a nice bar chart out of this ?  
BR  
G

---

<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: [24 March 2020 11:24 UTC](https://discourse.nodered.org/t/problem-with-filling-data-to-bar-chart/23553/2 "2020-03-24T11:24:29Z")

</div>

The data needs to be formatted differently for bar charts - see [https://github.com/node-red/node-red-dashboard/blob/master/Charts.md](https://github.com/node-red/node-red-dashboard/blob/master/Charts.md)

---

<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: [23 April 2020 11:24 UTC](https://discourse.nodered.org/t/problem-with-filling-data-to-bar-chart/23553/3 "2020-04-23T11:24:36Z")

</div>

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