# Dashboard Chart with Asynchronous Timestamps

**URL:** <https://discourse.nodered.org/t/dashboard-chart-with-asynchronous-timestamps/2430>\
**Category:** Dashboard\
**Created:** [20 August 2018 22:25 UTC](https://discourse.nodered.org/t/dashboard-chart-with-asynchronous-timestamps/2430 "2018-08-20T22:25:32Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![zacharyalan09](https://avatars.discourse-cdn.com/v4/letter/z/a587f6/32.png) [@zacharyalan09](https://discourse.nodered.org/u/zacharyalan09)\
**Post date:** [20 August 2018 22:25 UTC](https://discourse.nodered.org/t/dashboard-chart-with-asynchronous-timestamps/2430/1 "2018-08-20T22:25:32Z")

</div>

Hello -

I sometimes need to operate the raspberry pi running node-red without access to the internet. When I do the clock loses sync with world time as I cycle power on and off. I see now when the clock on the Raspi is not sync'd I have problems with the line chart X-axis on my browser.

It appears that the right end of the chart is scaling to the current time on the client PC but the server PC is providing data that's timestamped from a few hours ago (10 minutes worth) and the chart is compressed. Has anyone experienced this? Workaround ideas?

When the times are sync'd this chart displays as expected with a total X axis range of 10 minutes.

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/1/103a4bea1228d9430015dd31e3a7d61a429c44c0.png)

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [21 August 2018 00:13 UTC](https://discourse.nodered.org/t/dashboard-chart-with-asynchronous-timestamps/2430/2 "2018-08-21T00:13:25Z")

</div>

Why not add a realtime clock to the Pi? [https://www.adafruit.com/product/3386](https://www.adafruit.com/product/3386)

---

<div class="post-metadata">

**Author:** ![shrickus](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/shrickus/32/517_2.png) [@shrickus](https://discourse.nodered.org/u/shrickus)\
**Post date:** [21 August 2018 02:45 UTC](https://discourse.nodered.org/t/dashboard-chart-with-asynchronous-timestamps/2430/3 "2018-08-21T02:45:41Z")

</div>

This issue has come up before -- essentially, the `ui_chart` x-axis always wants to zoom to the current time (the right end of the axis).

DCeeJay, I can't remember exactly why, but I seem to recall you telling me there was not a good option for zooming to only the visible data set (or perhaps it wasn't easy to add another option)?

---

<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:** [21 August 2018 08:04 UTC](https://discourse.nodered.org/t/dashboard-chart-with-asynchronous-timestamps/2430/4 "2018-08-21T08:04:46Z")

</div>

> [@zacharyalan09](#):
>
> sometimes need to operate the raspberry pi running node-red without access to the internet

You could configure your PC (or another machine on the local network) as an ntp server. Then the pi can synchronise to the PC. Assuming you are running LInux then that is not difficult and google should help you. Don't know about Windows, but a quick google suggests that again it might not be too difficult.

---

<div class="post-metadata">

**Author:** ![davidcgu](https://avatars.discourse-cdn.com/v4/letter/d/e8c25b/32.png) [@davidcgu](https://discourse.nodered.org/u/davidcgu)\
**Post date:** [21 August 2018 08:38 UTC](https://discourse.nodered.org/t/dashboard-chart-with-asynchronous-timestamps/2430/5 "2018-08-21T08:38:18Z")

</div>

Install an RTC module on you raspi as well as you do on an arduino board,google it 10-15$ an many instructables as example:

> **[Adding a Real Time Clock to your Raspberry Pi](https://thepihut.com/blogs/raspberry-pi-tutorials/17209332-adding-a-real-time-clock-to-your-raspberry-pi)**
>
> When you switch on your PC or Mac, do you have to change its time? Highly unlikely! Do you have to on your Raspberry Pi? Possibly. Each time your Raspberry Pi boots it connects to what is called an NTP - Network Time Protocol - server and asks it the...

Regards

---

<div class="post-metadata">

**Author:** ![ghayne](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ghayne/32/39_2.png) [@ghayne](https://discourse.nodered.org/u/ghayne)\
**Post date:** [21 August 2018 09:07 UTC](https://discourse.nodered.org/t/dashboard-chart-with-asynchronous-timestamps/2430/6 "2018-08-21T09:07:53Z")

</div>

Colin's suggestion is probably the easiest solution, if you do have to use a RTC as David suggested, try to get one with a **Dallas DS3231** chip, they are very accurate. If you follow David's link above they have a modules based on this chip.

---

<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:** [21 August 2018 17:00 UTC](https://discourse.nodered.org/t/dashboard-chart-with-asynchronous-timestamps/2430/7 "2018-08-21T17:00:29Z")

</div>

Indeed the dashboard is aimed at displaying real-time data rather than historical... which does really mean that clocks need to be in sync...

Generally if it's on a local network then a local timeserver is the simplest approach - usually you just need to add a server line to the ntp.conf file- but I see on latest Raspbian for Pi (Stretch) it is now in the file /etc/systemd/timesyncd.conf instead.

---

<div class="post-metadata">

**Author:** ![zacharyalan09](https://avatars.discourse-cdn.com/v4/letter/z/a587f6/32.png) [@zacharyalan09](https://discourse.nodered.org/u/zacharyalan09)\
**Post date:** [27 August 2018 19:55 UTC](https://discourse.nodered.org/t/dashboard-chart-with-asynchronous-timestamps/2430/8 "2018-08-27T19:55:59Z")

</div>

Thanks for all of the advice folks. I have a Dallas DS3231 chip on the way.

Zach
