# Perspecrive XY CHART Question

**URL:** <https://forum.inductiveautomation.com/t/perspecrive-xy-chart-question/72550>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [April 18, 2023, 12:35am UTC](https://forum.inductiveautomation.com/t/perspecrive-xy-chart-question/72550 "2023-04-18T00:35:53Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jiyoung\_hwang1](https://avatars.discourse-cdn.com/v4/letter/j/bc79bd/32.png) [@jiyoung\_hwang1](https://forum.inductiveautomation.com/u/jiyoung_hwang1)\
**Post date:** [April 18, 2023, 12:35am UTC](https://forum.inductiveautomation.com/t/perspecrive-xy-chart-question/72550/1 "2023-04-18T00:35:53Z")

</div>

I use xy chart and I want to specify the number of y-axis grids. What should I do?

 ![1](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/7/97987a70c2910ab51ee97fe952632252f2b784d7.gif)

---

<div class="post-metadata">

**Author:** ![andrew.budaiev](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/andrew.budaiev/32/72921_2.png) [@andrew.budaiev](https://forum.inductiveautomation.com/u/andrew.budaiev)\
**Post date:** [April 18, 2023, 12:59am UTC](https://forum.inductiveautomation.com/t/perspecrive-xy-chart-question/72550/2 "2023-04-18T00:59:16Z")

</div>

You can play with `yAxes.appearance.grid.minDistance.`

---

<div class="post-metadata">

**Author:** ![jiyoung\_hwang1](https://avatars.discourse-cdn.com/v4/letter/j/bc79bd/32.png) [@jiyoung\_hwang1](https://forum.inductiveautomation.com/u/jiyoung_hwang1)\
**Post date:** [April 18, 2023, 1:25am UTC](https://forum.inductiveautomation.com/t/perspecrive-xy-chart-question/72550/4 "2023-04-18T01:25:07Z")

</div>

I did it the way you told me

Even if minDistance is 0.5, it becomes this detailed, but I want to make only 5 grids.

 ![1](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/c/8c41b1da0c26617d1bb57a66fddd01f57f24f888.gif)

---

<div class="post-metadata">

**Author:** ![andrew.budaiev](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/andrew.budaiev/32/72921_2.png) [@andrew.budaiev](https://forum.inductiveautomation.com/u/andrew.budaiev)\
**Post date:** [April 18, 2023, 1:26am UTC](https://forum.inductiveautomation.com/t/perspecrive-xy-chart-question/72550/5 "2023-04-18T01:26:43Z")

</div>

Try make a number bigger, try `1, 5, 10, 50, 100,` etc. until it looks like you want

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [April 18, 2023, 1:55am UTC](https://forum.inductiveautomation.com/t/perspecrive-xy-chart-question/72550/6 "2023-04-18T01:55:03Z")

</div>

> [@jiyoung\_hwang1](#):
>
> Even if minDistance is 0.5, it becomes this detailed, but I want to make only 5 grids.

Setting it to 0.5 isn't going to produce 5 gridlines, even if there weren't smarts to work out how many will actually fit on the graph; you would get 100s of 1000s of gridlines (600k)

If you want 5 gridlines dynamically, then you will need to:

1. set the min/max y range statically (`props.yAxes[x].value.range.min/max` and set `useStrict` to `true`)
2. set `props.yAxes[x].appearance.grid.minDistance` = expression binding:

```auto
({this.props.yAxes[x].value.range.max}-{this.props.yAxes[x].value.range.min})/5

```

where x = the array item index of your yAxis.  
right click on this prop and turn on the "persistent" option so that the value is saved with the view (not technically required, but it's better if you do)

However, it looks like there is some logic to make these numbers logical, so depending what this evaluates to, you might see 5 or less gridlines.

---

<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:** [January 6, 2025, 11:31pm UTC](https://forum.inductiveautomation.com/t/perspecrive-xy-chart-question/72550/7 "2025-01-06T23:31:45Z")

</div>

I think that `yAxes.0.appearance.grid.minDistance` is supposed to set this but I can't get it to work. I think it doesn't work. There doesn't seem to be much of a clue on the [Axes – amCharts 5 Documentation](https://www.amcharts.com/docs/v5/charts/xy-chart/axes/) (on which the component is based).

Nick Minchin had some comments on it in [Perspecrive XY CHART Question - #6 by nminchin](https://forum.inductiveautomation.com/t/perspecrive-xy-chart-question/72550/6).
