# Line chart time plot in Dashboard2

**URL:** https://discourse.nodered.org/t/line-chart-time-plot-in-dashboard2/93300
**Category:** Dashboard
**Tags:** dashboard-2
**Created:** [20 November 2024 22:38 UTC](https://discourse.nodered.org/t/line-chart-time-plot-in-dashboard2/93300 "2024-11-20T22:38:13Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![YK934](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/yk934/32/96555_2.png) [@YK934](https://discourse.nodered.org/u/YK934)
#### Post date: [20 November 2024 22:38 UTC](https://discourse.nodered.org/t/line-chart-time-plot-in-dashboard2/93300/1 "2024-11-20T22:38:13Z")

</div>

Hi,

I have another question about time plotting on Dashbord2 line chart.

In mysql table has UTC timestamp and add local time column with query below. When give this data set to chart, different time scale showed up as below. The UTC is 13:00 and local\_time is 0:00 but 10AM. Current NodeRED server location is Brisbane, 1 hour behind from Sydeny but still different from that. Is there anyway to show the local time as X axis scale?

```auto
SELECT CONVERT_TZ(DateTime, 'UTC', 'Australia/Sydney') as local_time, datetime,
    id, stuncurrent, stunvoltage 
FROM Stun_log.Stunlog1 
WHERE datetime >= CONVERT_TZ(CONCAT('2024-11-17', ' 00:00:00'), 'Australia/Sydney', 'UTC')
     AND datetime < CONVERT_TZ(CONCAT('2024-11-17'+ INTERVAL 1 DAY, ' 00:00:00') , 'Australia/Sydney', 'UTC')
 limit 4;

```

```auto
[
  {
    "local_time": "2024-11-17T00:00:08.000Z",
    "datetime": "2024-11-16T13:00:08.000Z",
    "id": 12336,
    "stuncurrent": 11,
    "stunvoltage": 230
  },
  {
    "local_time": "2024-11-17T00:00:18.000Z",
    "datetime": "2024-11-16T13:00:18.000Z",
    "id": 12337,
    "stuncurrent": 11,
    "stunvoltage": 240
  },
  {
    "local_time": "2024-11-17T00:00:28.000Z",
    "datetime": "2024-11-16T13:00:28.000Z",
    "id": 12338,
    "stuncurrent": 11,
    "stunvoltage": 250
  },
  {
    "local_time": "2024-11-17T00:00:38.000Z",
    "datetime": "2024-11-16T13:00:38.000Z",
    "id": 12339,
    "stuncurrent": 11,
    "stunvoltage": 260
  }
]

```

 ![{DD27705B-6ADD-4053-88F8-23DFC54DB996}](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/6/26ec0c8c59f3faa085dd2559e3ffac568c068659.png)

 ![{9E5B2777-7D25-4D8A-9FD4-0848BE72463E}](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/d/6d17c7849c6e63a9290130cc8764d1bf84eb08da.png)

---

<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 November 2024 11:18 UTC](https://discourse.nodered.org/t/line-chart-time-plot-in-dashboard2/93300/2 "2024-11-21T11:18:33Z")

</div>

You should leave the timestamps in UTC, the browser should display them in the local time of the browser.

---

<div class="post-metadata">

### Author: ![YK934](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/yk934/32/96555_2.png) [@YK934](https://discourse.nodered.org/u/YK934)
#### Post date: [22 November 2024 00:13 UTC](https://discourse.nodered.org/t/line-chart-time-plot-in-dashboard2/93300/3 "2024-11-22T00:13:03Z")

</div>

Thank you Colin,

Once changed the X axis to UTC, it shows good. So time scale will be changed if access from different timezone. It is ok for now still shows same same data set.

---

<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: [22 December 2024 00:13 UTC](https://discourse.nodered.org/t/line-chart-time-plot-in-dashboard2/93300/4 "2024-12-22T00:13:41Z")

</div>

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