Subplot gap on standard chart

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?

I figured it out!

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

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

1 Like

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?

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.

Perfect! Thank you!!!

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:

chart.plot.gap = x
2 Likes