Classic chart X axis Visible property

I’m not sure this code would hide both axes, as getDomainAxis() returns the Axis with an index of 0.

You can use getDomainAxis() with an index parameter to get a specific axis.

event.source.parent.parent.getComponent('CTN_Charts').getComponent('Chart).getChart().getXYPlot().getDomainAxis(1).setVisibile(0)