# X axis time won't change as per the need

**URL:** <https://discourse.nodered.org/t/x-axis-time-wont-change-as-per-the-need/47786>\
**Category:** Dashboard\
**Created:** [29 June 2021 10:35 UTC](https://discourse.nodered.org/t/x-axis-time-wont-change-as-per-the-need/47786 "2021-06-29T10:35:00Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![KrishnanRavichandran](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/krishnanravichandran/32/44858_2.png) [@KrishnanRavichandran](https://discourse.nodered.org/u/KrishnanRavichandran)\
**Post date:** [29 June 2021 10:35 UTC](https://discourse.nodered.org/t/x-axis-time-wont-change-as-per-the-need/47786/1 "2021-06-29T10:35:00Z")

</div>

I am using ADAM 6717 for obtaining data from the sensors.

I have the need to plot the chart to show the incoming datas. Thought I make the X axis to last 1 hour or 1 day or minutes, I do not have any change in the chart displayed.

This is the chart input

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/e/fe65ba869f62f0e7f046175f4dc6017f1418ab6c.png)

This is the graph output.  
 ![forum2](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/c/dc26c17383e41e6e26875f3c69ab0b9c724d1a54.png)

Can any of you help me to get the X axis as required? I would need it for one day and to show the value at the right time. Here the X axis shows 5 am but I am obtaining the input at 11 am. How to get the data on a acurate time?

---

<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:** [29 June 2021 10:47 UTC](https://discourse.nodered.org/t/x-axis-time-wont-change-as-per-the-need/47786/2 "2021-06-29T10:47:10Z")

</div>

How are you adding data to the chart?

---

<div class="post-metadata">

**Author:** ![KrishnanRavichandran](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/krishnanravichandran/32/44858_2.png) [@KrishnanRavichandran](https://discourse.nodered.org/u/KrishnanRavichandran)\
**Post date:** [29 June 2021 10:48 UTC](https://discourse.nodered.org/t/x-axis-time-wont-change-as-per-the-need/47786/3 "2021-06-29T10:48:09Z")

</div>

The data from the chart is coming from a Sensor measuring the pressure.

---

<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:** [29 June 2021 10:49 UTC](https://discourse.nodered.org/t/x-axis-time-wont-change-as-per-the-need/47786/4 "2021-06-29T10:49:33Z")

</div>

Yes, you said that, but what exact messages are you sending to the chart. Add a debug node showing what is going to the chart. Set is to Output Complete Message and show us what it says.

Is the timestamp at the right hand side of the chart showing the correct time?

---

<div class="post-metadata">

**Author:** ![KrishnanRavichandran](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/krishnanravichandran/32/44858_2.png) [@KrishnanRavichandran](https://discourse.nodered.org/u/KrishnanRavichandran)\
**Post date:** [29 June 2021 10:53 UTC](https://discourse.nodered.org/t/x-axis-time-wont-change-as-per-the-need/47786/5 "2021-06-29T10:53:30Z")

</div>

![forum 3](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/b/ab7f7f0c36aa35b21bb410a77b08c149f2dd137b.png)

I suppose the output shows the current time.

---

<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:** [29 June 2021 11:00 UTC](https://discourse.nodered.org/t/x-axis-time-wont-change-as-per-the-need/47786/6 "2021-06-29T11:00:54Z")

</div>

When the chart was given that message did it add a point at the right hand side with value 0.317?

---

<div class="post-metadata">

**Author:** ![KrishnanRavichandran](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/krishnanravichandran/32/44858_2.png) [@KrishnanRavichandran](https://discourse.nodered.org/u/KrishnanRavichandran)\
**Post date:** [29 June 2021 11:02 UTC](https://discourse.nodered.org/t/x-axis-time-wont-change-as-per-the-need/47786/7 "2021-06-29T11:02:50Z")

</div>

yes, it added to its right a point with value 0.317

---

<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:** [29 June 2021 11:18 UTC](https://discourse.nodered.org/t/x-axis-time-wont-change-as-per-the-need/47786/8 "2021-06-29T11:18:40Z")

</div>

So the new value has been added at the correct time. So what is the problem?

Possibly you are confused by the fact that when you set a time range greater than the time range for the data available it does not initially increase the range shown. You have to wait for the chart to fill up. So if, for example, you set the range to one hour and start with an empty chart then it will take an hour for the chart to fill up and show the complete hour. Before that time it will show the oldest data it has at the left hand side.

---

<div class="post-metadata">

**Author:** ![KrishnanRavichandran](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/krishnanravichandran/32/44858_2.png) [@KrishnanRavichandran](https://discourse.nodered.org/u/KrishnanRavichandran)\
**Post date:** [29 June 2021 11:56 UTC](https://discourse.nodered.org/t/x-axis-time-wont-change-as-per-the-need/47786/9 "2021-06-29T11:56:22Z")

</div>

I got it now !  
thanks for explaining it to me.  
But, why does the time shown here in the chart is different from the actual time?

---

<div class="post-metadata">

**Author:** ![KrishnanRavichandran](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/krishnanravichandran/32/44858_2.png) [@KrishnanRavichandran](https://discourse.nodered.org/u/KrishnanRavichandran)\
**Post date:** [29 June 2021 12:31 UTC](https://discourse.nodered.org/t/x-axis-time-wont-change-as-per-the-need/47786/10 "2021-06-29T12:31:16Z")

</div>

Can I have the X axis to always show from a specific start time to end time? for eg: from one day, or half day? and how to get the correct time value on the x axis?

---

<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:** [29 June 2021 12:39 UTC](https://discourse.nodered.org/t/x-axis-time-wont-change-as-per-the-need/47786/11 "2021-06-29T12:39:56Z")

</div>

> [@KrishnanRavichandran](#):
>
> Can I have the X axis to always show from a specific start time to end time?

Do you mean you don't want to send it live data but instead want to fill the chart with existing historical data?

> [@KrishnanRavichandran](#):
>
> how to get the correct time value on the x axis?

You said that when you passed it the value 0.317 then the point was added at the correct timestamp at the right hand side of the chart.

---

<div class="post-metadata">

**Author:** ![KrishnanRavichandran](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/krishnanravichandran/32/44858_2.png) [@KrishnanRavichandran](https://discourse.nodered.org/u/KrishnanRavichandran)\
**Post date:** [29 June 2021 12:55 UTC](https://discourse.nodered.org/t/x-axis-time-wont-change-as-per-the-need/47786/12 "2021-06-29T12:55:04Z")

</div>

I got the value added to the right, but not at the correct time.

1. My X axis shows a different time value from the real time. (as in my first msg here at the top) How to get the same time in hours and minutes on the chart as that of the real time. I have an error showing the values at 5 am when the readings were taken at 11 am.

2. Is it possible to have a chart with constant X axis from 7 am till 17 pm and data getting updated in it? or so. This was my next question

---

<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:** [29 June 2021 12:56 UTC](https://discourse.nodered.org/t/x-axis-time-wont-change-as-per-the-need/47786/13 "2021-06-29T12:56:32Z")

</div>

> [@KrishnanRavichandran](#):
>
> My X axis shows a different time value from the real time.

You said earlier that the right hand side of the chart shows the correct current time. Is that not right? If not then check the time and timezone settings on the device running node red and the device running the browser. Probably one of them is wrong.  
Let's deal with the second question once you have the chart working.

---

<div class="post-metadata">

**Author:** ![KrishnanRavichandran](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/krishnanravichandran/32/44858_2.png) [@KrishnanRavichandran](https://discourse.nodered.org/u/KrishnanRavichandran)\
**Post date:** [29 June 2021 13:01 UTC](https://discourse.nodered.org/t/x-axis-time-wont-change-as-per-the-need/47786/14 "2021-06-29T13:01:57Z")

</div>

Thank you for your patience and answers.

The timestamp at the debug node with the output complete message shows the right time, but the chart shows a different time. How come this can happen?

I have also tried to open it in different browsers. But still the same error persists.

---

<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:** [29 June 2021 13:07 UTC](https://discourse.nodered.org/t/x-axis-time-wont-change-as-per-the-need/47786/15 "2021-06-29T13:07:39Z")

</div>

As I said. If the timestamp at the right hand side of the chart is not correct (so when you took the screenshot at the start the time was _not_ just after 1PM) then you have either the time or timezone is wrong in the device running node-red or in the one running the browser. That assumes you are running an up to date version of node-red-dashboard of course, though I don't remember any bugs that would cause that.

Is the time at the right hand side of the chart a whole number of hours wrong? If so is it the same as your offset from UTC?

---

<div class="post-metadata">

**Author:** ![KrishnanRavichandran](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/krishnanravichandran/32/44858_2.png) [@KrishnanRavichandran](https://discourse.nodered.org/u/KrishnanRavichandran)\
**Post date:** [29 June 2021 13:52 UTC](https://discourse.nodered.org/t/x-axis-time-wont-change-as-per-the-need/47786/16 "2021-06-29T13:52:38Z")

</div>

I get to understand now, the time on the right side is the current time!  
Then I get the time correct to the current time as it is 3 45 PM (GMT+1) and the chart has the following view.  
 ![forum 4](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/3/134b10e688f0ac7bda377637bdd074ace89829f3.png)

But, I made a change in the input data now, but the change is shown on top of 9 am instead of 3 45 pm. Do you think I am missing something again?

---

<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:** [29 June 2021 14:09 UTC](https://discourse.nodered.org/t/x-axis-time-wont-change-as-per-the-need/47786/18 "2021-06-29T14:09:58Z")

</div>

As I have said multiple times before, you almost certainly have the wrong time or timezone set somewhere. Where is node-red running and where is the browser running? If on each of those systems (not in node-red) you show the current time and zone what do they say?

Also how did you install node-red? Is it a Docker install or running in a VM for example?

---

<div class="post-metadata">

**Author:** ![KrishnanRavichandran](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/krishnanravichandran/32/44858_2.png) [@KrishnanRavichandran](https://discourse.nodered.org/u/KrishnanRavichandran)\
**Post date:** [29 June 2021 14:28 UTC](https://discourse.nodered.org/t/x-axis-time-wont-change-as-per-the-need/47786/19 "2021-06-29T14:28:11Z")

</div>

The Node-red is installed on a ADAM 6717 - gateway module, which is a virtual machine. But the settings of this has been checked once you mentioned about the time settings.

 ![forum 5](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/0/10ccbdb5465062b0801f370765d0159e6787185f.png)

On my PC as well, the time zone is correctly set to the GMT+1.

---

<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:** [29 June 2021 14:31 UTC](https://discourse.nodered.org/t/x-axis-time-wont-change-as-per-the-need/47786/20 "2021-06-29T14:31:08Z")

</div>

That is saying the current time is 16:22:27 + 8 hours so that is the problem.

---

<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:** [29 June 2021 14:33 UTC](https://discourse.nodered.org/t/x-axis-time-wont-change-as-per-the-need/47786/21 "2021-06-29T14:33:35Z")

</div>

I would have expected it to be +1, matching the time zone

[Next page](https://discourse.nodered.org/t/x-axis-time-wont-change-as-per-the-need/47786.md?page=2)
