# Dynamic and static data

**URL:** <https://discourse.nodered.org/t/dynamic-and-static-data/35837>\
**Category:** Dashboard\
**Created:** [12 November 2020 21:51 UTC](https://discourse.nodered.org/t/dynamic-and-static-data/35837 "2020-11-12T21:51:42Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![punkass18](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/punkass18/32/31897_2.png) [@punkass18](https://discourse.nodered.org/u/punkass18)\
**Post date:** [12 November 2020 21:51 UTC](https://discourse.nodered.org/t/dynamic-and-static-data/35837/1 "2020-11-12T21:51:42Z")

</div>

Hello,

I can preload the line ui-chart with a stored data from SQL and of course I can add data dynamically. But I would like to do them at the same time. Preload a static chart from database and add new data dynamically. (Short charts, just to see the difference between the old and the live chart) I have found a solution how to set the right timestamp but my chart looks weird it keeps blinking I think it re-renders the chart every time.

```auto
[{"id":"b566090c.fcf998","type":"ui_button","z":"e0a5c277.f1753","name":"","group":"f3e75316.ec407","order":1,"width":0,"height":0,"passthru":false,"label":"start (after 10 sec you can see the new chart)","tooltip":"","color":"","bgcolor":"","icon":"","payload":"open","payloadType":"str","topic":"control","x":230,"y":440,"wires":[["be1413c8.48d82"]]},{"id":"f3e75316.ec407","type":"ui_group","name":"Relative","tab":"379107b8.4087e8","order":2,"disp":true,"width":"12"},{"id":"379107b8.4087e8","type":"ui_tab","name":"Random","icon":"dashboard"}]

```

---

<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:** [12 November 2020 21:59 UTC](https://discourse.nodered.org/t/dynamic-and-static-data/35837/2 "2020-11-12T21:59:32Z")

</div>

If you are replacing all the data (from the database) then yes it is redrawing the entire chart, and as the axes are calculated based on the data then they get redrawn as well.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [12 November 2020 22:06 UTC](https://discourse.nodered.org/t/dynamic-and-static-data/35837/3 "2020-11-12T22:06:55Z")

</div>

Only fill it from the database once, don't keep doing it, then you can add new data on the end in the normal way.

---

<div class="post-metadata">

**Author:** ![punkass18](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/punkass18/32/31897_2.png) [@punkass18](https://discourse.nodered.org/u/punkass18)\
**Post date:** [12 November 2020 22:28 UTC](https://discourse.nodered.org/t/dynamic-and-static-data/35837/4 "2020-11-12T22:28:06Z")

</div>

I have tried before, the preloaded chart disappears immediately when I inject the new 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:** [13 November 2020 00:22 UTC](https://discourse.nodered.org/t/dynamic-and-static-data/35837/5 "2020-11-13T00:22:47Z")

</div>

the timestamps of the new data vs the old must be within the time span of the chart.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [13 November 2020 08:58 UTC](https://discourse.nodered.org/t/dynamic-and-static-data/35837/6 "2020-11-13T08:58:51Z")

</div>

> [@punkass18](#):
>
> I have tried before, the preloaded chart disappears immediately when I inject the new data.

What message are you sending to add new data? It should just be the topic containing line series name with the value in the payload.

---

<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:** [13 December 2020 08:59 UTC](https://discourse.nodered.org/t/dynamic-and-static-data/35837/7 "2020-12-13T08:59:02Z")

</div>

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