# \[Perspective XY Chart\] X-Axis date offset by 1 hour

**URL:** <https://forum.inductiveautomation.com/t/perspective-xy-chart-x-axis-date-offset-by-1-hour/79281>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [September 18, 2023, 12:35pm UTC](https://forum.inductiveautomation.com/t/perspective-xy-chart-x-axis-date-offset-by-1-hour/79281 "2023-09-18T12:35:03Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marc.Akoto](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/marc.akoto/32/19291_2.png) [@Marc.Akoto](https://forum.inductiveautomation.com/u/Marc.Akoto)\
**Post date:** [September 18, 2023, 12:35pm UTC](https://forum.inductiveautomation.com/t/perspective-xy-chart-x-axis-date-offset-by-1-hour/79281/1 "2023-09-18T12:35:03Z")

</div>

Hi there,

In a perspective XY Chart, the X-Axis is displayed with a 1-hour offset  
See below : dataset ranges from 10am to 12pm, whereas X-Axis is displayed from 11am to 1pm

Same issue from within the Designer (same session timezone than the gateway)

Any idea how to fix this ?

Below a summary of my dataset and parameters

> **dataSource**
>
> [  
> {  
> "ds0": {  
> "$": [  
> "ds",  
> 192,  
> 1695039976849  
> ],  
> "$columns": [  
> {  
> "name": "date\_lavage",  
> "type": "Date",  
> "data": [  
> 1694679000000,  
> 1694679600000,  
> 1694680200000,  
> 1694680800000,  
> 1694681400000,  
> 1694682000000,  
> 1694682600000,  
> 1694683200000,  
> 1694683800000,  
> 1694684400000,  
> 1694685000000  
> ]  
> },  
> {  
> "name": "c01\_1\_right\_up",  
> "type": "Double",  
> "data": [  
> 101.979164,  
> 102.10648,  
> 102.5897,  
> 102.170135,  
> 101.77951,  
> 102.59838,  
> 103.0353,  
> 102.49421,  
> 102.30903,  
> 102.54051,  
> 102.546295  
> ]  
> },  
> {  
> "name": "c02\_1\_left\_up",  
> "type": "Double",  
> "data": [  
> 103.020836,  
> 102.986115,  
> 102.922455,  
> 102.323494,  
> 102.572334,  
> 103.104744,  
> 103.62558,  
> 103.37384,  
> 103.24364,  
> 103.36806,  
> 103.451965  
> ]  
> },  
> {  
> "name": "c03\_1\_right\_down",  
> "type": "Double",  
> "data": [  
> 102.673615,  
> 103.16551,  
> 103.81655,  
> 105.41377,  
> 105.19386,  
> 104.03356,  
> 104.05382,  
> 103.9294,  
> 103.385414,  
> 103.4809,  
> 103.85706  
> ]  
> },  
> {  
> "name": "c04\_1\_left\_down",  
> "type": "Double",  
> "data": [  
> 102.49132,  
> 102.728584,  
> 102.91956,  
> 104.46759,  
> 104.86979,  
> 103.86864,  
> 103.729744,  
> 103.6603,  
> 103.295715,  
> 103.521416,  
> 103.56192  
> ]  
> },  
> {  
> "name": "c05\_2\_right\_up",  
> "type": "Double",  
> "data": [  
> 101.322334,  
> 101.197914,  
> 101.55382,  
> 101.68403,  
> 102.61864,  
> 101.55382,  
> 101.64931,  
> 101.65799,  
> 101.43519,  
> 101.06481,  
> 101.579865  
> ]  
> },  
> {  
> "name": "c06\_2\_left\_up",  
> "type": "Double",  
> "data": [  
> 100.59606,  
> 100.50347,  
> 100.763885,  
> 100.81597,  
> 101.41782,  
> 100.45718,  
> 101.03009,  
> 100.865166,  
> 100.83912,  
> 100.74653,  
> 101.021416  
> ]  
> },  
> {  
> "name": "c07\_2\_right\_down",  
> "type": "Double",  
> "data": [  
> 101.99653,  
> 102.02257,  
> 101.74769,  
> 101.69271,  
> 103.53009,  
> 103.85127,  
> 102.24537,  
> 103.142365,  
> 102.734375,  
> 102.103584,  
> 102.572334  
> ]  
> },  
> {  
> "name": "c08\_2\_left\_down",  
> "type": "Double",  
> "data": [  
> 104.042244,  
> 104.11169,  
> 104.14352,  
> 104.03935,  
> 105.19676,  
> 105.96354,  
> 104.80035,  
> 105.07523,  
> 104.5978,  
> 104.53125,  
> 104.60648  
> ]  
> },  
> {  
> "name": "c09\_3\_right\_up",  
> "type": "Double",  
> "data": [  
> 104.32002,  
> 104.06829,  
> 104.759834,  
> 104.1522,  
> 102.02546,  
> 103.19155,  
> 105.06076,  
> 105.50636,  
> 104.37789,  
> 103.55614,  
> 105.448494  
> ]  
> },  
> {  
> "name": "c10\_3\_left\_up",  
> "type": "Double",  
> "data": [  
> 104.34028,  
> 104.03646,  
> 104.80035,  
> 104.10301,  
> 101.77373,  
> 102.546295,  
> 104.05671,  
> 104.48785,  
> 103.41146,  
> 103.11632,  
> 104.99711  
> ]  
> },  
> {  
> "name": "c11\_3\_right\_down",  
> "type": "Double",  
> "data": [  
> 110.09549,  
> 110.36748,  
> 110.50636,  
> 110.30093,  
> 109.64989,  
> 110.677086,  
> 111.229744,  
> 111.889465,  
> 111.71875,  
> 110.75231,  
> 111.59433  
> ]  
> },  
> {  
> "name": "c12\_3\_left\_down",  
> "type": "Double",  
> "data": [  
> 106.01852,  
> 106.35706,  
> 106.59433,  
> 106.56829,  
> 106.15162,  
> 106.9184,  
> 107.16435,  
> 108.078705,  
> 107.46817,  
> 106.958916,  
> 107.17593  
> ]  
> }  
> ]  
> }  
> }  
> ]

> **xAxes**
>
> [  
> {  
> "name": "date\_lavage",  
> "label": {  
> "enabled": true,  
> "text": "date de fixage",  
> "color": ""  
> },  
> "inversed": false,  
> "visible": true,  
> "tooltip": {  
> "enabled": true,  
> "text": "",  
> "cornerRadius": 3,  
> "pointerLength": 4,  
> "background": {  
> "color": "",  
> "opacity": 1  
> }  
> },  
> "render": "date",  
> "category": {  
> "break": {  
> "enabled": false,  
> "startCategory": "",  
> "endCategory": "",  
> "size": 0.05  
> }  
> },  
> "date": {  
> "baseInterval": {  
> "enabled": false,  
> "timeUnit": "minute",  
> "count": 1,  
> "skipEmptyPeriods": false  
> },  
> "range": {  
> "max": "",  
> "min": "",  
> "useStrict": false  
> },  
> "break": {  
> "enabled": false,  
> "startDate": "",  
> "endDate": "",  
> "size": 0.05  
> },  
> "inputFormat": "dd/MM/yyyy kk:mm:ss",  
> "format": "M/dd kk:mm"  
> },  
> "value": {  
> "range": {  
> "max": "",  
> "min": "",  
> "useStrict": false  
> },  
> "logarithmic": false,  
> "break": {  
> "enabled": false,  
> "startValue": 0,  
> "endValue": 100,  
> "size": 0.05  
> },  
> "format": "#,###"  
> },  
> "appearance": {  
> "opposite": false,  
> "inside": false,  
> "labels": {  
> "color": "",  
> "opacity": 1,  
> "rotation": 90,  
> "verticalCenter": "middle",  
> "horizontalCenter": "middle"  
> },  
> "grid": {  
> "color": "",  
> "opacity": 1,  
> "dashArray": "",  
> "minDistance": 10,  
> "position": 0.5  
> },  
> "font": {  
> "size": 12,  
> "weight": 500  
> }  
> }  
> }  
> ]

> **yAxes.0**
>
> [  
> {  
> "name": "c01\_1\_right\_up",  
> "label": {  
> "enabled": false,  
> "text": "",  
> "color": ""  
> },  
> "inversed": false,  
> "visible": true,  
> "tooltip": {  
> "enabled": true,  
> "text": "",  
> "cornerRadius": 3,  
> "pointerLength": 4,  
> "background": {  
> "color": "",  
> "opacity": 1  
> }  
> },  
> "render": "value",  
> "category": {  
> "break": {  
> "enabled": false,  
> "startCategory": "",  
> "endCategory": "",  
> "size": 0.05  
> }  
> },  
> "date": {  
> "baseInterval": {  
> "enabled": false,  
> "timeUnit": "minute",  
> "count": 1,  
> "skipEmptyPeriods": false  
> },  
> "range": {  
> "max": "",  
> "min": "",  
> "useStrict": false  
> },  
> "break": {  
> "enabled": false,  
> "startDate": "",  
> "endDate": "",  
> "size": 0.05  
> },  
> "inputFormat": "dd/MM/yyyy kk:mm:ss",  
> "format": "M/dd kk:mm"  
> },  
> "value": {  
> "range": {  
> "max": 113,  
> "min": 96,  
> "useStrict": true  
> },  
> "logarithmic": false,  
> "break": {  
> "enabled": false,  
> "startValue": 0,  
> "endValue": 100,  
> "size": 0.05  
> },  
> "format": "#,###.##"  
> },  
> "appearance": {  
> "opposite": false,  
> "inside": false,  
> "labels": {  
> "color": "",  
> "opacity": 1,  
> "rotation": 0,  
> "verticalCenter": "middle",  
> "horizontalCenter": "middle"  
> },  
> "grid": {  
> "color": "",  
> "opacity": 1,  
> "dashArray": "",  
> "minDistance": null,  
> "position": 0.5  
> },  
> "font": {  
> "size": "",  
> "weight": 500  
> }  
> }  
> }  
> ]

> **series.0**
>
> [  
> {  
> "name": "c01\_1\_right\_up",  
> "label": {  
> "text": ""  
> },  
> "visible": true,  
> "hiddenInLegend": false,  
> "defaultState": {  
> "visible": true  
> },  
> "data": {  
> "source": "ds0",  
> "x": "date\_lavage",  
> "y": "c01\_1\_right\_up"  
> },  
> "xAxis": "date\_lavage",  
> "yAxis": "c01\_1\_right\_up",  
> "zIndex": 0,  
> "tooltip": {  
> "enabled": true,  
> "text": "{name}: [bold]{valueY}[/]",  
> "cornerRadius": 3,  
> "pointerLength": 4,  
> "background": {  
> "color": "",  
> "opacity": 1  
> }  
> },  
> "render": "line",  
> "candlestick": {  
> "open": {  
> "x": "",  
> "y": ""  
> },  
> "high": {  
> "x": "",  
> "y": ""  
> },  
> "low": {  
> "x": "",  
> "y": ""  
> },  
> "appearance": {  
> "fill": {  
> "color": "",  
> "opacity": 1  
> },  
> "stroke": {  
> "color": "",  
> "opacity": 1,  
> "width": 1  
> },  
> "stacked": false,  
> "deriveFieldsFromData": {  
> "fill": {  
> "color": "",  
> "opacity": ""  
> },  
> "stroke": {  
> "color": "",  
> "opacity": "",  
> "width": ""  
> }  
> },  
> "heatRules": {  
> "enabled": false,  
> "max": "",  
> "min": "",  
> "dataField": ""  
> }  
> }  
> },  
> "column": {  
> "open": {  
> "x": "",  
> "y": ""  
> },  
> "appearance": {  
> "fill": {  
> "color": "",  
> "opacity": 1  
> },  
> "stroke": {  
> "color": "",  
> "opacity": 1,  
> "width": 1  
> },  
> "width": null,  
> "height": null,  
> "stacked": false,  
> "deriveFieldsFromData": {  
> "fill": {  
> "color": "",  
> "opacity": ""  
> },  
> "stroke": {  
> "color": "",  
> "opacity": "",  
> "width": ""  
> }  
> },  
> "heatRules": {  
> "enabled": false,  
> "max": "",  
> "min": "",  
> "dataField": ""  
> }  
> }  
> },  
> "line": {  
> "open": {  
> "x": "",  
> "y": ""  
> },  
> "appearance": {  
> "connect": true,  
> "tensionX": 1,  
> "tensionY": 1,  
> "minDistance": 0.5,  
> "stroke": {  
> "width": 3,  
> "opacity": 1,  
> "color": "#FFCA8A",  
> "dashArray": ""  
> },  
> "fill": {  
> "color": "",  
> "opacity": 0  
> },  
> "bullets": [  
> {  
> "enabled": false,  
> "render": "circle",  
> "width": 10,  
> "height": 10,  
> "label": {  
> "text": "{value}",  
> "position": {  
> "dx": 0,  
> "dy": 0  
> }  
> },  
> "tooltip": {  
> "enabled": true,  
> "text": "{name}: [bold]{valueY}[/]",  
> "cornerRadius": 3,  
> "pointerLength": 4,  
> "background": {  
> "color": "",  
> "opacity": 1  
> }  
> },  
> "fill": {  
> "color": "",  
> "opacity": 1  
> },  
> "stroke": {  
> "color": "",  
> "width": 1,  
> "opacity": 1  
> },  
> "rotation": 0,  
> "deriveFieldsFromData": {  
> "fill": {  
> "color": "",  
> "opacity": ""  
> },  
> "stroke": {  
> "color": "",  
> "opacity": "",  
> "width": ""  
> },  
> "rotation": ""  
> },  
> "heatRules": {  
> "enabled": false,  
> "max": 100,  
> "min": 2,  
> "dataField": ""  
> }  
> }  
> ]  
> }  
> },  
> "stepLine": {  
> "open": {  
> "x": "",  
> "y": ""  
> },  
> "appearance": {  
> "connect": true,  
> "tensionX": 1,  
> "tensionY": 1,  
> "minDistance": 0.5,  
> "stroke": {  
> "width": 3,  
> "opacity": 1,  
> "color": "",  
> "dashArray": ""  
> },  
> "fill": {  
> "color": "",  
> "opacity": 0  
> },  
> "bullets": [  
> {  
> "enabled": true,  
> "render": "circle",  
> "width": 10,  
> "height": 10,  
> "label": {  
> "text": "{value}",  
> "position": {  
> "dx": 0,  
> "dy": 0  
> }  
> },  
> "tooltip": {  
> "enabled": true,  
> "text": "{name}: [bold]{valueY}[/]",  
> "cornerRadius": 3,  
> "pointerLength": 4,  
> "background": {  
> "color": "",  
> "opacity": 1  
> }  
> },  
> "fill": {  
> "color": "",  
> "opacity": 1  
> },  
> "stroke": {  
> "color": "",  
> "width": 1,  
> "opacity": 1  
> },  
> "rotation": 0,  
> "deriveFieldsFromData": {  
> "fill": {  
> "color": "",  
> "opacity": ""  
> },  
> "stroke": {  
> "color": "",  
> "opacity": "",  
> "width": ""  
> },  
> "rotation": ""  
> },  
> "heatRules": {  
> "enabled": false,  
> "max": 100,  
> "min": 2,  
> "dataField": ""  
> }  
> }  
> ]  
> }  
> }  
> }  
> ]

 ![XY chart date offset](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/e/eee3fccb21f839f9526a68820def5c13588c7103.png)

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [September 18, 2023, 1:06pm UTC](https://forum.inductiveautomation.com/t/perspective-xy-chart-x-axis-date-offset-by-1-hour/79281/2 "2023-09-18T13:06:18Z")

</div>

What is the client timezone? (This looks like normal formatting of date/times on the client side for the chart, while I'm guessing that you formatted the dates in the labels with an expression, which runs in the gateway.)

---

<div class="post-metadata">

**Author:** ![sydney.bosworth](https://avatars.discourse-cdn.com/v4/letter/s/aca169/32.png) [@sydney.bosworth](https://forum.inductiveautomation.com/u/sydney.bosworth)\
**Post date:** [September 18, 2023, 1:49pm UTC](https://forum.inductiveautomation.com/t/perspective-xy-chart-x-axis-date-offset-by-1-hour/79281/3 "2023-09-18T13:49:50Z")

</div>

The data is actually correct, Just the X-axis starts an hour sooner and ends an hour later than you expected, right?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [September 18, 2023, 1:51pm UTC](https://forum.inductiveautomation.com/t/perspective-xy-chart-x-axis-date-offset-by-1-hour/79281/4 "2023-09-18T13:51:47Z")

</div>

> [@sydney.bosworth](#):
>
> starts an hour sooner and ends an hour later

Both ends are "later". (But almost certainly correct for the browser time zone, as shown in the session props.)

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [September 18, 2023, 1:54pm UTC](https://forum.inductiveautomation.com/t/perspective-xy-chart-x-axis-date-offset-by-1-hour/79281/5 "2023-09-18T13:54:57Z")

</div>

This topic might help:

> [@Ignition Perspective Page to show the client System date and time](https://forum.inductiveautomation.com/t/ignition-perspective-page-to-show-the-client-system-date-and-time/73265/8):
>
> Sure. I recommend [DateTimeFormatter.ofPattern()](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/time/format/DateTimeFormatter.html#ofPattern(java.lang.String)). But I would move the complexity to a project script module with a DateTimeFormatter instance with your preferred pattern saved as a top level variable. Like so, perhaps: from java.time import ZoneId from java.time.format import DateTimeFormatter defaultFormatter = DateTimeFormatter.ofPattern("YYYY-MM-dd HH:mm") def zonedFormat(ts, zoneid, format=None): formatter = defaultFormatter if format is None else DateTimeFormatter.ofPattern(format) r…

---

<div class="post-metadata">

**Author:** ![Marc.Akoto](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/marc.akoto/32/19291_2.png) [@Marc.Akoto](https://forum.inductiveautomation.com/u/Marc.Akoto)\
**Post date:** [September 18, 2023, 2:17pm UTC](https://forum.inductiveautomation.com/t/perspective-xy-chart-x-axis-date-offset-by-1-hour/79281/6 "2023-09-18T14:17:55Z")

</div>

Client tz is Europe/Paris (CET)

Currently the 'Project Timezone' is set to 'Gateway Timezone'  
`Project Properties > Perspective > General > Project Timezone > 'Gateway Timezone'`  
No difference when I change it to 'Client Timezone'

For the dates label I just wrote `M/dd kk:mm` as the output format

---

<div class="post-metadata">

**Author:** ![Marc.Akoto](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/marc.akoto/32/19291_2.png) [@Marc.Akoto](https://forum.inductiveautomation.com/u/Marc.Akoto)\
**Post date:** [September 19, 2023, 7:43am UTC](https://forum.inductiveautomation.com/t/perspective-xy-chart-x-axis-date-offset-by-1-hour/79281/7 "2023-09-19T07:43:01Z")

</div>

Solution : basic date format of the label : `M/dd HH:mm` instead of `M/dd kk:mm` ... hence the 1-hour offset, as explained in the documentation.

Thanks @pturmel and @sydney.bosworth for putting me on the path !

[https://docs.inductiveautomation.com/display/DOC81/Data+Type+Formatting+Reference](https://docs.inductiveautomation.com/display/DOC81/Data+Type+Formatting+Reference)
