Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8093722

NumberAxis autoranging: unexpected behaviour when constructing via builder or FXML

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Incomplete
    • Icon: P4 P4
    • None
    • 7u10
    • javafx

      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.

            jgiles Jonathan Giles
            wlehmann Werner Lehmann
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: