# Line chart not showing gap on 'null'

**URL:** https://discourse.nodered.org/t/line-chart-not-showing-gap-on-null/28586
**Category:** General
**Created:** [19 June 2020 05:06 UTC](https://discourse.nodered.org/t/line-chart-not-showing-gap-on-null/28586 "2020-06-19T05:06:40Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![KoenWindey](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/koenwindey/32/7900_2.png) [@KoenWindey](https://discourse.nodered.org/u/KoenWindey)
#### Post date: [19 June 2020 05:06 UTC](https://discourse.nodered.org/t/line-chart-not-showing-gap-on-null/28586/1 "2020-06-19T05:06:41Z")

</div>

Hi everyone,

I have a setup whereby an MQTT node is subscribed to a remote site and getting a temperature value. I show the temperature on a line chart.

Once in a while the communications drop out and come back. I want to show the loss of comms as a gap in the line chart.

At the moment I monitor the status of the MQTT node and if it changes state from 'connnected' to something else, i send a message to the line chart with payload 'null'. According to this; [https://github.com/node-red/node-red-dashboard/blob/master/Charts.md](https://github.com/node-red/node-red-dashboard/blob/master/Charts.md) that should greate 'gaps'. but it doesn't. When MQTT comes back, the line chart just draws an interpolation from the last value to the new one and simply ignores the 'null'. What am I missing here?

Thanks  
Koen

 ![Capture](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/1/91c0836a81489843d72ed330ae0cea9220854725.png)

---

<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: [19 June 2020 05:20 UTC](https://discourse.nodered.org/t/line-chart-not-showing-gap-on-null/28586/2 "2020-06-19T05:20:14Z")

</div>

Just a guess but do you have `msg.topic` same for both branches going to the chart node?

---

<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: [19 June 2020 07:06 UTC](https://discourse.nodered.org/t/line-chart-not-showing-gap-on-null/28586/3 "2020-06-19T07:06:32Z")

</div>

And what exactly is in the function node ?

---

<div class="post-metadata">

### Author: ![KoenWindey](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/koenwindey/32/7900_2.png) [@KoenWindey](https://discourse.nodered.org/u/KoenWindey)
#### Post date: [19 June 2020 11:45 UTC](https://discourse.nodered.org/t/line-chart-not-showing-gap-on-null/28586/4 "2020-06-19T11:45:57Z")

</div>

Genius!!

Of course the topic was different - it came from the status node..... Somehow that didn't trigger me after reading the manual a number of times.

Thank you.

---

<div class="post-metadata">

### Author: ![KoenWindey](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/koenwindey/32/7900_2.png) [@KoenWindey](https://discourse.nodered.org/u/KoenWindey)
#### Post date: [19 June 2020 11:49 UTC](https://discourse.nodered.org/t/line-chart-not-showing-gap-on-null/28586/5 "2020-06-19T11:49:25Z")

</div>

The function node was just:

![Annotation 2020-06-19 214849](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/0/b099ec17960a874ad082a123fe1eb55ae3298eda.png)

Now I added a force on the topic and it works.

---

<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: [3 July 2020 11:49 UTC](https://discourse.nodered.org/t/line-chart-not-showing-gap-on-null/28586/6 "2020-07-03T11:49:30Z")

</div>

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