# Subplot gap on standard chart

**URL:** <https://forum.inductiveautomation.com/t/subplot-gap-on-standard-chart/17306>\
**Category:** Ignition\
**Created:** [March 9, 2018, 10:25pm UTC](https://forum.inductiveautomation.com/t/subplot-gap-on-standard-chart/17306 "2018-03-09T22:25:16Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![JNelson](https://avatars.discourse-cdn.com/v4/letter/j/3be4f8/32.png) [@JNelson](https://forum.inductiveautomation.com/u/JNelson)\
**Post date:** [March 9, 2018, 10:25pm UTC](https://forum.inductiveautomation.com/t/subplot-gap-on-standard-chart/17306/1 "2018-03-09T22:25:16Z")

</div>

I need a way to set the subplot gap on a standard chart.

I can do it on the Easy Chart by going to  
getComponent(‘Easy Chart’).setSubplotGap(x)

Any ideas?

---

<div class="post-metadata">

**Author:** ![JNelson](https://avatars.discourse-cdn.com/v4/letter/j/3be4f8/32.png) [@JNelson](https://forum.inductiveautomation.com/u/JNelson)\
**Post date:** [March 13, 2018, 8:26pm UTC](https://forum.inductiveautomation.com/t/subplot-gap-on-standard-chart/17306/2 "2018-03-13T20:26:36Z")

</div>

I figured it out!

```auto
getComponent('Chart').getChart().getPlot().setGap(x)

```

I don’t know why it took me so long to find. 😬

---

<div class="post-metadata">

**Author:** ![JNelson](https://avatars.discourse-cdn.com/v4/letter/j/3be4f8/32.png) [@JNelson](https://forum.inductiveautomation.com/u/JNelson)\
**Post date:** [March 21, 2018, 4:39pm UTC](https://forum.inductiveautomation.com/t/subplot-gap-on-standard-chart/17306/3 "2018-03-21T16:39:32Z")

</div>

The above solution only works temporarily, so I put the code under the window event, “internalFrameActivated”  
Now, it sets the gap any time the windows is opened. The only problem is, if you zoom in on part of the chart, the gap disappears when you zoom back out.

Is there any way to “PERMANENTLY” set the gap?

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [March 21, 2018, 5:02pm UTC](https://forum.inductiveautomation.com/t/subplot-gap-on-standard-chart/17306/4 "2018-03-21T17:02:11Z")

</div>

Put the code into the `configureChart` extension function on the easy chart/classic chart itself. That way, every time the chart has to repaint/reconfigure itself, it will run your custom code.

---

<div class="post-metadata">

**Author:** ![JNelson](https://avatars.discourse-cdn.com/v4/letter/j/3be4f8/32.png) [@JNelson](https://forum.inductiveautomation.com/u/JNelson)\
**Post date:** [March 21, 2018, 6:03pm UTC](https://forum.inductiveautomation.com/t/subplot-gap-on-standard-chart/17306/5 "2018-03-21T18:03:12Z")

</div>

> [@paul-griffith](#):
>
> configureChart

Perfect! Thank you!!!!

---

<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:** [June 15, 2018, 2:15pm UTC](https://forum.inductiveautomation.com/t/subplot-gap-on-standard-chart/17306/6 "2018-06-15T14:15:00Z")

</div>

A tip to save some typing: Thanks to jython’s auto-interpretation of getters and setters, and the configureChart() method’s chart parameter, you can use this:

```auto
chart.plot.gap = x

```

---

<div class="post-metadata">

**Author:** ![robb](https://avatars.discourse-cdn.com/v4/letter/r/a183cd/32.png) [@robb](https://forum.inductiveautomation.com/u/robb)\
**Post date:** [March 29, 2023, 4:18pm UTC](https://forum.inductiveautomation.com/t/subplot-gap-on-standard-chart/17306/7 "2023-03-29T16:18:04Z")

</div>

I used your shortened format, and recently am getting an error at launch saying this isn't a supported command, but if I removed the chart.plot.gap = 15 it definitely moves the charts around.
