# X-axis in xy chart in Perspective

**URL:** <https://forum.inductiveautomation.com/t/x-axis-in-xy-chart-in-perspective/105989>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [May 7, 2025, 3:31pm UTC](https://forum.inductiveautomation.com/t/x-axis-in-xy-chart-in-perspective/105989 "2025-05-07T15:31:20Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![freggianini](https://avatars.discourse-cdn.com/v4/letter/f/e95f7d/32.png) [@freggianini](https://forum.inductiveautomation.com/u/freggianini)\
**Post date:** [May 7, 2025, 3:31pm UTC](https://forum.inductiveautomation.com/t/x-axis-in-xy-chart-in-perspective/105989/1 "2025-05-07T15:31:20Z")

</div>

Hello,  
how can i set the x-axis to have ONLY the value of my t\_stamp?

i would like to have only 5:00, 6:00... and not also 5:30, 6:30...

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/d/6d19a7981ce4b12224bc368d96327527f3406048.png)

Moreover i would like to have the labels with t\_stamp at the center of the y-series values.  
Now they are configured as "middle" but it seems they are randomly placed...

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/5/65cf38f4d7e98552f180000072879d842b0188a0.png)

Appreciate who could help.

thanks

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [May 7, 2025, 3:34pm UTC](https://forum.inductiveautomation.com/t/x-axis-in-xy-chart-in-perspective/105989/2 "2025-05-07T15:34:40Z")

</div>

Try increasing `xAxes.0.appearance.grid.minDistance`.  
Start with doubling it.

> minDistance   
> The minimum distance (in pixels) between grid lines. If set to NULL, the default value will be 120. Default value is 60.   
> value: numeric  
> [Perspective - XY Chart | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/appendix/components/perspective-components/perspective-chart-palette/perspective-xy-chart#xaxesappearancegrid)

---

<div class="post-metadata">

**Author:** ![freggianini](https://avatars.discourse-cdn.com/v4/letter/f/e95f7d/32.png) [@freggianini](https://forum.inductiveautomation.com/u/freggianini)\
**Post date:** [May 8, 2025, 6:03am UTC](https://forum.inductiveautomation.com/t/x-axis-in-xy-chart-in-perspective/105989/3 "2025-05-08T06:03:22Z")

</div>

it works, thanks.

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

now, it seems that my data are not centered into the timestamp range zone. they seems to be on the left side.

also it seems that the x axis is cropped on the rigts side.

thanks in advance

---

<div class="post-metadata">

**Author:** ![freggianini](https://avatars.discourse-cdn.com/v4/letter/f/e95f7d/32.png) [@freggianini](https://forum.inductiveautomation.com/u/freggianini)\
**Post date:** [May 8, 2025, 6:56am UTC](https://forum.inductiveautomation.com/t/x-axis-in-xy-chart-in-perspective/105989/4 "2025-05-08T06:56:11Z")

</div>

on the browser it works fine

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

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [May 8, 2025, 7:05am UTC](https://forum.inductiveautomation.com/t/x-axis-in-xy-chart-in-perspective/105989/5 "2025-05-08T07:05:21Z")

</div>

To shift the grid adjust `xAxes.0.appearance.grid.position` between 0 and 1. See [Perspective - XY Chart | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/appendix/components/perspective-components/perspective-chart-palette/perspective-xy-chart#xaxesappearancegrid).

> Also it seems that the x axis is cropped on the right side.

I think you are mis-using the XY Chart by treating timestamps as categories. I see two options:

1. Set `xAxes.0.render : category` and see if that fixes it.
2. Add an expression to `xAxes.0.date.range.min`:

```python
addMinutes(
	{this.props.dataSources.example[0].t_stamp},
	-30
)

```

... and `xAxes.0.date.range.max` might be something like this untested expression:

```python
addMinutes(
	{this.props.dataSources.example}[len({this.props.dataSources.example}) - 1]['t_stamp'],
	30
)

```

> On the browser it works fine.

That makes design awkward.

---

<div class="post-metadata">

**Author:** ![freggianini](https://avatars.discourse-cdn.com/v4/letter/f/e95f7d/32.png) [@freggianini](https://forum.inductiveautomation.com/u/freggianini)\
**Post date:** [May 14, 2025, 1:41pm UTC](https://forum.inductiveautomation.com/t/x-axis-in-xy-chart-in-perspective/105989/6 "2025-05-14T13:41:18Z")

</div>

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/8/9898207764406e753530fec9731f862f77799aaa.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/4/b4831cf17e4fecdd789bba9bafb33a4448831bdd.png)

if i set to category, then i have the timestamp in millisecond and some Y values dissapear (upper photo)

moreover, in dataSources, i have 4 values.

---

<div class="post-metadata">

**Author:** ![freggianini](https://avatars.discourse-cdn.com/v4/letter/f/e95f7d/32.png) [@freggianini](https://forum.inductiveautomation.com/u/freggianini)\
**Post date:** [May 14, 2025, 1:58pm UTC](https://forum.inductiveautomation.com/t/x-axis-in-xy-chart-in-perspective/105989/7 "2025-05-14T13:58:51Z")

</div>

setting the base interval, i was able to fix the chart

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