I'm afraid crimolvic problem is not related to autoscale...
"Reset scale layout" can't be accessed programmatically. So you can't correct a corrupted X scale !
😞However, you can protect the scale from being damaged by unchecking the autoadjust scale property (right click > advanced). This will keep the graph size unchanged when the Y scale is modified.
Have a look at
this thread
Chilly Charly (aka CC)