# Perspective XY Chart X-axis value positioning

**URL:** <https://forum.inductiveautomation.com/t/perspective-xy-chart-x-axis-value-positioning/26850>\
**Category:** Ignition\
**Tags:** ignition80\
**Created:** [July 24, 2019, 8:05pm UTC](https://forum.inductiveautomation.com/t/perspective-xy-chart-x-axis-value-positioning/26850 "2019-07-24T20:05:08Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [July 24, 2019, 8:05pm UTC](https://forum.inductiveautomation.com/t/perspective-xy-chart-x-axis-value-positioning/26850/1 "2019-07-24T20:05:08Z")

</div>

The values in the x-axis don’t quite coincide with the data. In this example, the shift starts at 5AM (where the dip in the data occurs). I can shift the grid to compensate, but I can’t find a way to shift the grid values.

Before moving the grid:  
 ![1](https://us1.discourse-cdn.com/inductiveautomation/original/2X/6/6e3fa550a8d550b8f0242f56348f9c615569319a.png)

After  
 ![2](https://us1.discourse-cdn.com/inductiveautomation/original/2X/9/9cf6d0ba6694f3d671df667ed9196f6f25bd1c51.png)

---

<div class="post-metadata">

**Author:** ![md.szyman](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/md.szyman/32/9240_2.png) [@md.szyman](https://forum.inductiveautomation.com/u/md.szyman)\
**Post date:** [July 25, 2019, 12:05pm UTC](https://forum.inductiveautomation.com/t/perspective-xy-chart-x-axis-value-positioning/26850/2 "2019-07-25T12:05:08Z")

</div>

This is possible in the underlying AMCharts library that Perspective uses, but it isn’t exposed within Perspective and can’t be done as is.

---

<div class="post-metadata">

**Author:** ![ynejati](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ynejati/32/6093_2.png) [@ynejati](https://forum.inductiveautomation.com/u/ynejati)\
**Post date:** [July 25, 2019, 3:22pm UTC](https://forum.inductiveautomation.com/t/perspective-xy-chart-x-axis-value-positioning/26850/3 "2019-07-25T15:22:29Z")

</div>

Hi,

That’s strange. The chart should align the data out of the box. It is currently possible to set a start range on a particular axis in addition to shifting the grid over on either axis. Do you mind sharing your config and an example snippet of your data? Feel free to DM me if you’re more comfortable that way.

-Yousuf

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [July 25, 2019, 4:02pm UTC](https://forum.inductiveautomation.com/t/perspective-xy-chart-x-axis-value-positioning/26850/4 "2019-07-25T16:02:53Z")

</div>

Hi Yousuf, (EDIT: Sorry for the misspell, my friend! )

I attached everything i could think of. I removed the binding from the chart in the uploaded view, to keep the existing data, but have a screen shot of the binding setup and an export of the values from the named query

[values.csv](https://us1.discourse-cdn.com/inductiveautomation/original/2X/9/908e13d82effc3e5dd604083bd7c3a970813e5b4.csv) (201.1 KB)  
[JC\_perpsective\_xy\_2019-07-25\_1140.zip](https://us1.discourse-cdn.com/inductiveautomation/original/2X/5/58bed16d3742eded5ace8e897c112c9e735f1b96.zip) (54.0 KB)

 ![XY%20Setup](https://us1.discourse-cdn.com/inductiveautomation/original/2X/a/a8321fd091e30e83dfcb62a476b22f0366769895.png)

---

<div class="post-metadata">

**Author:** ![ynejati](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ynejati/32/6093_2.png) [@ynejati](https://forum.inductiveautomation.com/u/ynejati)\
**Post date:** [July 29, 2019, 5:27pm UTC](https://forum.inductiveautomation.com/t/perspective-xy-chart-x-axis-value-positioning/26850/5 "2019-07-29T17:27:00Z")

</div>

Hi,

Sorry for the delay. I would try returning a date time string instead of a unix timestamp. Currently looks like it does a better job at parsing date time strings than timestamps for some reason.

For the x-axis configuration, set the baseInterval to 1 hour and make sure it’s enabled. Format the date so that it reads `hh:mm` instead of `hh`.

For the grid appearance, you can set the minDistance to 15 and adjust the grid position to 0.5 (you might need to adjust these depending on the size of the chart).

I would also recommend rotating the labels 90 degrees (this is located under appearance, available in RC2).

Might be a good idea to enable x trace too by setting `cursor.series = eff60`.

The XYChart is meant to intelligently adjust the the number of labels based upon the available space. If your chart is static in size, you might be able to adjust the minDistance and position properties to achieve the look you want.

Hopefully that helps.

-Yousuf

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [July 29, 2019, 6:02pm UTC](https://forum.inductiveautomation.com/t/perspective-xy-chart-x-axis-value-positioning/26850/6 "2019-07-29T18:02:29Z")

</div>

Thanks for the reply, Yousuf. I can say that none of that worked for 8.0.2. 😄

I’ll get RC2 loaded up some time this afternoon and see what happens.

---

<div class="post-metadata">

**Author:** ![ken.maze](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ken.maze/32/85876_2.png) [@ken.maze](https://forum.inductiveautomation.com/u/ken.maze)\
**Post date:** [January 12, 2024, 9:48pm UTC](https://forum.inductiveautomation.com/t/perspective-xy-chart-x-axis-value-positioning/26850/7 "2024-01-12T21:48:43Z")

</div>

You've probably solved this, given up, or just moved on by now, but in case someone else sees a problem like this like I did today, I changed appearance.labels.horizontalCenter from right to left, and it looked good after that

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/5/853e6048216edb88d7dc13545f872be8a8c49c44.png)

Editor, showing horizontalCenter correctly set to left  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/0/501f55496f4cb6367694c624c8aabf4d1b80a79a.png)

Before fixing

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/c/0c431298829ab12a1a06ee9890c7f5688dfafc23.png)

After Fixing
