# Filling stored data chart with real data

**URL:** <https://discourse.nodered.org/t/filling-stored-data-chart-with-real-data/11937>\
**Category:** Dashboard\
**Created:** [7 June 2019 10:15 UTC](https://discourse.nodered.org/t/filling-stored-data-chart-with-real-data/11937 "2019-06-07T10:15:58Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lupin\_III](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/lupin_iii/32/67650_2.png) [@Lupin\_III](https://discourse.nodered.org/u/Lupin_III)\
**Post date:** [7 June 2019 10:15 UTC](https://discourse.nodered.org/t/filling-stored-data-chart-with-real-data/11937/1 "2019-06-07T10:15:58Z")

</div>

Hi to all, I need some support in order to populate with real data a chart filled with stored data. Firstly when the flow starts I populate the chart with the array coming from MySQL, and it works fine. Once it’s started I need to go on filling the chart with real data which are sent just like normal payload. But the chart refresh loosing the stored data. I tried several ways, using series, topic, key… but nothing.

Thanks a lot, I'll really appreciate any effort to help me.

---

<div class="post-metadata">

**Author:** ![hotNipi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hotnipi/32/383_2.png) [@hotNipi](https://discourse.nodered.org/u/hotNipi)\
**Post date:** [7 June 2019 10:32 UTC](https://discourse.nodered.org/t/filling-stored-data-chart-with-real-data/11937/2 "2019-06-07T10:32:24Z")

</div>

You can't switch between those two was of data feeding into chart. What you can do, is store new data into database, get new portion of data (latest included, oldest removed) from database and feed it as historical data.

---

<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:** [7 June 2019 10:53 UTC](https://discourse.nodered.org/t/filling-stored-data-chart-with-real-data/11937/3 "2019-06-07T10:53:28Z")

</div>

Errrr of course you can switch and add data. BUT the timestamps must be in range of whatever you have set the chart to display. Eg if set to show last hour then while you can load a chart showing an hour from yesterday, as soon as new data arrives that will get wiped as its more than an hour old.

---

<div class="post-metadata">

**Author:** ![hotNipi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hotnipi/32/383_2.png) [@hotNipi](https://discourse.nodered.org/u/hotNipi)\
**Post date:** [7 June 2019 11:02 UTC](https://discourse.nodered.org/t/filling-stored-data-chart-with-real-data/11937/4 "2019-06-07T11:02:26Z")

</div>

> BUT the timestamps...

Oh that was the issue when I tried to do it similar way. Silly me 😃

---

<div class="post-metadata">

**Author:** ![Lupin\_III](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/lupin_iii/32/67650_2.png) [@Lupin\_III](https://discourse.nodered.org/u/Lupin_III)\
**Post date:** [7 June 2019 22:54 UTC](https://discourse.nodered.org/t/filling-stored-data-chart-with-real-data/11937/5 "2019-06-07T22:54:53Z")

</div>

Thanks a lot guys, but I still have problems. The last stored data is continuosly connected to the last real data value. At the and, the last real value is always connected with a line to the previous real data and with another line with the last stored data.  
 ![Chart](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/8/8c08f14b412d675fbcbf0ff91041a705e3b541e1.jpeg) ![Flow](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/d/dfc00f062051b7e1dfac957daf51dd0512d2b375.jpeg)

---

<div class="post-metadata">

**Author:** ![Lupin\_III](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/lupin_iii/32/67650_2.png) [@Lupin\_III](https://discourse.nodered.org/u/Lupin_III)\
**Post date:** [7 June 2019 22:55 UTC](https://discourse.nodered.org/t/filling-stored-data-chart-with-real-data/11937/6 "2019-06-07T22:55:33Z")

</div>

![Deb1](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/e/e23674a584ef1b09dd081497716a22bf0afa222e.jpeg) ![Deb2](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/4/4e47ec5de9d7ac9aeaf0455dcbbf62dec6ebd853.jpeg)

---

<div class="post-metadata">

**Author:** ![Lupin\_III](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/lupin_iii/32/67650_2.png) [@Lupin\_III](https://discourse.nodered.org/u/Lupin_III)\
**Post date:** [7 June 2019 22:56 UTC](https://discourse.nodered.org/t/filling-stored-data-chart-with-real-data/11937/7 "2019-06-07T22:56:33Z")

</div>

![Deb3](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/5/5fda5637f72b9831da32fa8d0fe8373f4a179959.jpeg) ![Deb4](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/7/7ed32158d0f3be7cebe9b45ed79da73e2e8b8eb8.jpeg)

---

<div class="post-metadata">

**Author:** ![Lupin\_III](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/lupin_iii/32/67650_2.png) [@Lupin\_III](https://discourse.nodered.org/u/Lupin_III)\
**Post date:** [7 June 2019 23:04 UTC](https://discourse.nodered.org/t/filling-stored-data-chart-with-real-data/11937/8 "2019-06-07T23:04:21Z")

</div>

Just to complete my issue, as label it is shown only the "F", as you can see.  
Finally, as following step I need to have two variables in the same chart. But I think this shouldn't be a big problem using the topic property, isnt'it?  
this is the last code I'm trying after your suggestions

```auto
[{"id":"b87ea5cc.16fa88","type":"mysql","z":"8e3f4b3f.d74588","mydb":"a52b589c.b402b8","name":"MySQL","x":260,"y":240,"wires":[["3cf48631.ebfe5a","78380142.debb3"]]},{"id":"a52b589c.b402b8","type":"MySQLdatabase","z":"","host":"localhost","port":"3306","db":"Prova","tz":"2"}]

```
