# Charts - weird things happening

**URL:** <https://discourse.nodered.org/t/charts-weird-things-happening/39253>\
**Category:** Dashboard\
**Created:** [17 January 2021 08:04 UTC](https://discourse.nodered.org/t/charts-weird-things-happening/39253 "2021-01-17T08:04:53Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [17 January 2021 08:04 UTC](https://discourse.nodered.org/t/charts-weird-things-happening/39253/1 "2021-01-17T08:04:53Z")

</div>

I guess pictures say 1000 words.

But.... Here's the _John Dory_:

I go to the dashboard and it is displayed - as much as can be expected.

But the graph/chart (see picture) is a bit...... scatty. (skatty?)

I press the REFRESH button (browser) and I get the second picture.

RasPiZ (W).  
Jessie  
NR 1.2.6.  
Dashboard 2.26.2  
This is not a recent thing. It has been going on for a while. I just decided to ask now to try and work out what is going on.

(oh, yeah: The pictures)

 ![Screenshot from 2021-01-17 19-00-18](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/0/601fbfb82a872318e71f908f3d50cc5de313ef13.png)

 ![Screenshot from 2021-01-17 19-00-26](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/5/05f01be5efd7bf19780a94a489a9375e65838255.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:** [17 January 2021 08:53 UTC](https://discourse.nodered.org/t/charts-weird-things-happening/39253/2 "2021-01-17T08:53:24Z")

</div>

Just thinking about it at the underlying internal logic level. Couple of versions back the chart initialization phase is changed to improve performance..  
Possible that processing that old heavy data from `replayMessage` took too long at the initialization and 2 new datapoints from live source came in before the the old data. Don't know if old datapoints can be rendered after newer datapoints already made scales of the chart to be different. Maybe.  
But then why after the refresh still has that old data exists ....

Anyway - chart with that many data in it is unreadable in therms of what for the line chart are meant to. The most you can read out is upper and lower limit over the time span. And for that you don't need line chart, it takes 2 numbers and 2 time strings to tell you that information.  
A lot faster and reliable dashboard will be if you optimize such heavy things out.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [17 January 2021 08:58 UTC](https://discourse.nodered.org/t/charts-weird-things-happening/39253/3 "2021-01-17T08:58:36Z")

</div>

Thanks.

But the chart on the left is tracking 2 things: CPU load and temperature.  
Not quite as long for time.

Not mission critical but I may shorten the displayed time for that 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:** [17 January 2021 09:42 UTC](https://discourse.nodered.org/t/charts-weird-things-happening/39253/4 "2021-01-17T09:42:55Z")

</div>

How did you get to the first image?

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [17 January 2021 09:43 UTC](https://discourse.nodered.org/t/charts-weird-things-happening/39253/5 "2021-01-17T09:43:25Z")

</div>

Went to that tab after a while.

---

<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:** [17 January 2021 09:59 UTC](https://discourse.nodered.org/t/charts-weird-things-happening/39253/6 "2021-01-17T09:59:48Z")

</div>

So do you mean that if you go to the tab then initially it starts of virtually empty, but if you refresh it fills up and correctly shows the older data?

---

<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:** [17 January 2021 10:02 UTC](https://discourse.nodered.org/t/charts-weird-things-happening/39253/7 "2021-01-17T10:02:47Z")

</div>

> [@Trying\_to\_learn](#):
>
> Went to that tab after a while.

That explains why the `replayMessage` from server-side is correct if you do refresh.  
Inactive tab behavior is not consistent across browsers, and it is practically impossible to figure out what is the state after wake-up specially if dealing with such data-driven renderings. Not much hope to find any fix ...

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [17 January 2021 10:06 UTC](https://discourse.nodered.org/t/charts-weird-things-happening/39253/8 "2021-01-17T10:06:28Z")

</div>

(On the bigger side of things)

I have Firefox - alas the one supplied with Ubuntu, **NOT** from Mozilla.

I have about..... 79 WINDOWS open. (restored every time I load firefox) and each of those have..... well, ranging from 1 to quite a lot of tabs.

No, they don't all load. Say after 30 minutes I click on the tab. It "loads" and I can't remember if it is showing all the past data or not.

But then, some time later I switch back to that tab and I get the first picture.  
I press REFRESH and it goes to the full set of past data.

As I said: Not the end of the world. The machine has 32 gig of ram. (Had to update from 16. It wasn't cutting it after updating Ubuntu to 20.10)

---

<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:** [17 January 2021 10:34 UTC](https://discourse.nodered.org/t/charts-weird-things-happening/39253/9 "2021-01-17T10:34:38Z")

</div>

> [@hotNipi](#):
>
> That explains why the `replayMessage` from server-side is correct if you do refresh.  
> Inactive tab behavior is not consistent across browsers,

Do you mean it is normal behaviour in the dashboard the if you have a chart on a browser tab that is not visible and then go to the tab that it does not initially show the chart correctly. I had not noticed that. I will try and test it.

---

<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:** [17 January 2021 10:35 UTC](https://discourse.nodered.org/t/charts-weird-things-happening/39253/10 "2021-01-17T10:35:09Z")

</div>

> [@Trying\_to\_learn](#):
>
> Went to that tab after a while.

Do you mean a browser tab or a dashboard tab?

---

<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:** [17 January 2021 10:54 UTC](https://discourse.nodered.org/t/charts-weird-things-happening/39253/11 "2021-01-17T10:54:12Z")

</div>

Hard to call it normal, but technically I think it is possible to fall into that situation. Inactive browser tab tries to be as low resource consumer as possible. All browsers do something about it. And that something is not same across the browsers. Who knows all of them.... and how an why..  
NR sends replayMessage if socket connection were down. But what if it wasn't? No data for configured period to show if inactive tab wakes up cos rendering were stopped and may be some memory sweeping happened also ... who knows...

---

<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:** [17 January 2021 10:57 UTC](https://discourse.nodered.org/t/charts-weird-things-happening/39253/12 "2021-01-17T10:57:16Z")

</div>

I would have expected the socket connection to timeout if the browser put the tab to sleep. However, who knows?

---

<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:** [16 February 2021 10:57 UTC](https://discourse.nodered.org/t/charts-weird-things-happening/39253/13 "2021-02-16T10:57:20Z")

</div>

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