# How to fix the x-axis on chart node

**URL:** https://discourse.nodered.org/t/how-to-fix-the-x-axis-on-chart-node/56056
**Category:** Dashboard
**Created:** [3 January 2022 18:33 UTC](https://discourse.nodered.org/t/how-to-fix-the-x-axis-on-chart-node/56056 "2022-01-03T18:33:17Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![OscarF](https://avatars.discourse-cdn.com/v4/letter/o/e79b87/32.png) [@OscarF](https://discourse.nodered.org/u/OscarF)
#### Post date: [3 January 2022 18:33 UTC](https://discourse.nodered.org/t/how-to-fix-the-x-axis-on-chart-node/56056/1 "2022-01-03T18:33:17Z")

</div>

Hi  
I'm using the node red 0.20.5 version and I have a trouble with the chart node, the x-axis isn't accurate and the timeline it's larger than I specified, so the data looks so close together. This is a image about how it looks:

![imagen](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/b/5bcce881c3c02a99083596e5a2c91555b262bc8b.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: [3 January 2022 18:41 UTC](https://discourse.nodered.org/t/how-to-fix-the-x-axis-on-chart-node/56056/2 "2022-01-03T18:41:23Z")

</div>

Can you post the data that you are charting?

---

<div class="post-metadata">

### Author: ![OscarF](https://avatars.discourse-cdn.com/v4/letter/o/e79b87/32.png) [@OscarF](https://discourse.nodered.org/u/OscarF)
#### Post date: [3 January 2022 20:06 UTC](https://discourse.nodered.org/t/how-to-fix-the-x-axis-on-chart-node/56056/3 "2022-01-03T20:06:37Z")

</div>

They're random numbers from 0 to 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: [3 January 2022 20:38 UTC](https://discourse.nodered.org/t/how-to-fix-the-x-axis-on-chart-node/56056/4 "2022-01-03T20:38:57Z")

</div>

Are you specifying timestamps or just feeding values? If timestamps then show us the data you are sending to the chart, if just feeding values then how are you doing that?

---

<div class="post-metadata">

### Author: ![OscarF](https://avatars.discourse-cdn.com/v4/letter/o/e79b87/32.png) [@OscarF](https://discourse.nodered.org/u/OscarF)
#### Post date: [3 January 2022 22:03 UTC](https://discourse.nodered.org/t/how-to-fix-the-x-axis-on-chart-node/56056/5 "2022-01-03T22:03:27Z")

</div>

I'm just feeding values, I'm doing it with an inject and a function node. The inject node is configured to repeat every second, and here is the code in the function node:

```auto
ran = parseInt(Math.random()*10);
msg.topic = "Input1";
msg.payload = ran;
return msg;

```

All the flow looks like this:

 ![imagen](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/e/cea87b97bd299eee500a9aa921e09d90b9cfe520.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: [3 January 2022 22:17 UTC](https://discourse.nodered.org/t/how-to-fix-the-x-axis-on-chart-node/56056/6 "2022-01-03T22:17:36Z")

</div>

Is the chart showing the correct current time at the right hand side?

Check the time and time zone in the node red machine and the machine running the browser.

Also what is your time zone?

---

<div class="post-metadata">

### Author: ![OscarF](https://avatars.discourse-cdn.com/v4/letter/o/e79b87/32.png) [@OscarF](https://discourse.nodered.org/u/OscarF)
#### Post date: [3 January 2022 22:24 UTC](https://discourse.nodered.org/t/how-to-fix-the-x-axis-on-chart-node/56056/7 "2022-01-03T22:24:49Z")

</div>

No, both are differents, the time in the right hand side is correct while the time in the chart is approximately eight hours late. My time zone is GMT-6.

---

<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: [3 January 2022 22:25 UTC](https://discourse.nodered.org/t/how-to-fix-the-x-axis-on-chart-node/56056/8 "2022-01-03T22:25:39Z")

</div>

Have you checked the time and zone settings? One of them is wrong.

---

<div class="post-metadata">

### Author: ![OscarF](https://avatars.discourse-cdn.com/v4/letter/o/e79b87/32.png) [@OscarF](https://discourse.nodered.org/u/OscarF)
#### Post date: [3 January 2022 22:35 UTC](https://discourse.nodered.org/t/how-to-fix-the-x-axis-on-chart-node/56056/9 "2022-01-03T22:35:03Z")

</div>

![imagen](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/8/f8e2d08b3e717caaf4a4287aac8fbc363a5984ff.png)  
 ![imagen](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/c/cc8e4417d0a20d8cf487a371eb119ccd42587cfa.png)

Apparently node red has the correct time, so how can I set the correct time in the 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: [4 January 2022 07:07 UTC](https://discourse.nodered.org/t/how-to-fix-the-x-axis-on-chart-node/56056/10 "2022-01-04T07:07:23Z")

</div>

Show us the time and timezone settings on the machine running node red and the machine running the browser. You haven't told us which OS you are using so I can't tell you how to do that. If node red is running in a Docker container then make sure the timezone is correct there.

---

<div class="post-metadata">

### Author: ![OscarF](https://avatars.discourse-cdn.com/v4/letter/o/e79b87/32.png) [@OscarF](https://discourse.nodered.org/u/OscarF)
#### Post date: [4 January 2022 15:15 UTC](https://discourse.nodered.org/t/how-to-fix-the-x-axis-on-chart-node/56056/11 "2022-01-04T15:15:03Z")

</div>

I'm using a gateway that has node red like a module, here is the log in the node red user's module:

 ![imagen](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/8/d84b449a48f0747b7501d3c2c5cf99be8464b128.png)

I don't know how to see the time on my browser machine, I'm using Firefox so if you can tell me how to see it, it would be great. Thanks for your help.

---

<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: [4 January 2022 15:34 UTC](https://discourse.nodered.org/t/how-to-fix-the-x-axis-on-chart-node/56056/12 "2022-01-04T15:34:18Z")

</div>

> [@OscarF](#):
>
> I'm using a gateway that has node red like a module

You need to look in the docs for the gateway to find out how to properly configure the time and time zone. Possibly it only understands UTC, so you have to give it the UTC time.

> [@OscarF](#):
>
> I don't know how to see the time on my browser machine, I'm using Firefox

It is nothing to do with the browser. If you are using Windows then I expect it is in the clock settings.

---

<div class="post-metadata">

### Author: ![OscarF](https://avatars.discourse-cdn.com/v4/letter/o/e79b87/32.png) [@OscarF](https://discourse.nodered.org/u/OscarF)
#### Post date: [4 January 2022 17:02 UTC](https://discourse.nodered.org/t/how-to-fix-the-x-axis-on-chart-node/56056/13 "2022-01-04T17:02:56Z")

</div>

The time on the gateway was wrong, the graph is fixed, thank you Colin.

---

<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: [18 January 2022 17:03 UTC](https://discourse.nodered.org/t/how-to-fix-the-x-axis-on-chart-node/56056/14 "2022-01-18T17:03:09Z")

</div>

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