By default a chart axis uses autoranging. When it is constructed with upper and lower bound the autoranging is turned off:
new NumberAxis(0, 50, 1)
However, when doing the same in FXML, autoranging stays on. This is quite unexpected and not at all obvious, since the same parameters are used:
<NumberAxis lowerBound="0" upperBound="50" tickUnit="1"/>
To work around this it is necessary to explicitly add autoRanging="false" to the FXML. This is probably simply caused by the fact that the NumberAxisBuilder first calls the no-args constructor which keeps autoranging on. Later the bounds are applied but that does not turn off autoranging.
new NumberAxis(0, 50, 1)
However, when doing the same in FXML, autoranging stays on. This is quite unexpected and not at all obvious, since the same parameters are used:
<NumberAxis lowerBound="0" upperBound="50" tickUnit="1"/>
To work around this it is necessary to explicitly add autoRanging="false" to the FXML. This is probably simply caused by the fact that the NumberAxisBuilder first calls the no-args constructor which keeps autoranging on. Later the bounds are applied but that does not turn off autoranging.