# Graph shows no data unless input changed

**URL:** <https://discourse.nodered.org/t/graph-shows-no-data-unless-input-changed/58844>\
**Category:** Dashboard\
**Created:** [22 February 2022 20:32 UTC](https://discourse.nodered.org/t/graph-shows-no-data-unless-input-changed/58844 "2022-02-22T20:32:03Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hayder](https://avatars.discourse-cdn.com/v4/letter/h/47e85d/32.png) [@Hayder](https://discourse.nodered.org/u/Hayder)\
**Post date:** [22 February 2022 20:32 UTC](https://discourse.nodered.org/t/graph-shows-no-data-unless-input-changed/58844/1 "2022-02-22T20:32:03Z")

</div>

I have made a simple dashboard, the problem is if the slider is not changed, the graph is frozen until the slider is being moved.  
If I do not change the slider value even for an hour, I got nothing instead of a steady line.Would you please help if you know any idea how to let the graph stamp the time and the slide value every second whether it is changed or not?

 ![1](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/4/f46418cdc3105d121c4c9ed4fd79321b00f3953e.jpeg) ![2](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/3/f3fa23a02aad8091ddca6697e445d52cadb17fe0.jpeg)

Appreciate your support.

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [22 February 2022 21:01 UTC](https://discourse.nodered.org/t/graph-shows-no-data-unless-input-changed/58844/2 "2022-02-22T21:01:53Z")

</div>

One way is to disconnect the slider from the chart and instead save the slider value in a variable.  
An inject node can be set to inject the variable value every second.  
Edit - sorry I changed the variable name from lastvalue to slidervalue but didn't change the node labels to match.  
 ![Untitled 5](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/c/8c293956759ab0f5f374ecf06bf4eb701af0bf64.jpeg)

---

<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:** [22 February 2022 21:08 UTC](https://discourse.nodered.org/t/graph-shows-no-data-unless-input-changed/58844/3 "2022-02-22T21:08:02Z")

</div>

Or connect the slider to a Trigger node configured to repeat the last payload.  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/d/1d8b9c4cd5af8f36a5b7b6f3c89a2212ca04a177.png)

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [22 February 2022 21:13 UTC](https://discourse.nodered.org/t/graph-shows-no-data-unless-input-changed/58844/4 "2022-02-22T21:13:35Z")

</div>

Much better!  
Why didn't I know the trigger node could do that? 😡

---

<div class="post-metadata">

**Author:** ![Hayder](https://avatars.discourse-cdn.com/v4/letter/h/47e85d/32.png) [@Hayder](https://discourse.nodered.org/u/Hayder)\
**Post date:** [22 February 2022 21:15 UTC](https://discourse.nodered.org/t/graph-shows-no-data-unless-input-changed/58844/5 "2022-02-22T21:15:16Z")

</div>

Thank you very much for your answer. I have tried this way but still, I got nothing. Colin's solution worked. Thank you.

---

<div class="post-metadata">

**Author:** ![Hayder](https://avatars.discourse-cdn.com/v4/letter/h/47e85d/32.png) [@Hayder](https://discourse.nodered.org/u/Hayder)\
**Post date:** [22 February 2022 21:17 UTC](https://discourse.nodered.org/t/graph-shows-no-data-unless-input-changed/58844/6 "2022-02-22T21:17:20Z")

</div>

Thank you very much. It worked very well, except when you started the dashboard, the graph was not shown until data changed then keep working as I wished perfectly. so if the temperature is not changed for some time, the first run of the dashboard will show an empty graph as the first image I attached.

---

<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:** [22 February 2022 21:18 UTC](https://discourse.nodered.org/t/graph-shows-no-data-unless-input-changed/58844/7 "2022-02-22T21:18:54Z")

</div>

> [@Hayder](#):
>
> if the temperature is not changed for some time, the first run of the dashboard will show an empty graph as the first image I attached.

Initialise the slider and the trigger node with an Inject node set to fire on startup with the initial value you want.

---

<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:** [22 February 2022 21:50 UTC](https://discourse.nodered.org/t/graph-shows-no-data-unless-input-changed/58844/8 "2022-02-22T21:50:28Z")

</div>

> [@jbudd](#):
>
> Why didn't I know the trigger node could do that?

It is a recent addition I think.

---

<div class="post-metadata">

**Author:** ![Hayder](https://avatars.discourse-cdn.com/v4/letter/h/47e85d/32.png) [@Hayder](https://discourse.nodered.org/u/Hayder)\
**Post date:** [22 February 2022 22:02 UTC](https://discourse.nodered.org/t/graph-shows-no-data-unless-input-changed/58844/9 "2022-02-22T22:02:46Z")

</div>

I guess the slider has no initial value until you move it. I will try to use real sensor data. However, I have learnt from your way how to use the exchange function. I am very beginner in Node-Red. Thank you

---

<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:** [22 February 2022 22:05 UTC](https://discourse.nodered.org/t/graph-shows-no-data-unless-input-changed/58844/10 "2022-02-22T22:05:53Z")

</div>

I recommend watching this playlist: [Node-RED Essentials](https://www.youtube.com/playlist?list=PLyNBB9VCLmo1hyO-4fIZ08gqFcXBkHy-6). The videos are done by the developers of node-red. They're nice & short and to the point. You will understand a whole lot in about 1 hour. A small investment for a lot of gain.

---

<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:** [22 February 2022 22:52 UTC](https://discourse.nodered.org/t/graph-shows-no-data-unless-input-changed/58844/11 "2022-02-22T22:52:03Z")

</div>

For about 5 years but not often used.

---

<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:** [23 February 2022 07:11 UTC](https://discourse.nodered.org/t/graph-shows-no-data-unless-input-changed/58844/12 "2022-02-23T07:11:54Z")

</div>

When you get to my age, five years is recent 🙂

---

<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:** [24 April 2022 07:12 UTC](https://discourse.nodered.org/t/graph-shows-no-data-unless-input-changed/58844/13 "2022-04-24T07:12:48Z")

</div>

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