Classic Chart all axes auto range

Hello,
how is it possible to set classic chart Auto Range All Axes with scripting?
I would like to assign to button the same functionality available through right click.

I figured it out.
In case somebody needs it:

[code]chart = event.source.parent.parent.getComponent(‘Chart’)
axes = chart.getYAxes()
defaultAxis = axes.get(“Default Y Axis”)
isAutoRange = defaultAxis.autoRange
if isAutoRange == 0:
for axis in axes:
currentAxis = axes.get(axis)
currentAxis.autoRange = 1
elif isAutoRange == 1:
for axis in axes:
currentAxis = axes.get(axis)
currentAxis.autoRange = 0

chart.setYAxes(axes)
chart.createChart())[/code]

1 Like