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

[Chart] Custom AutoTickUnit strategies

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 8u20
    • javafx
    • JDK 8u20, Win 7 Pro SP1, 64 Bit

      For the charts we are drawing, often Axis's builtin AutoRange strategy is unsufficient w.r.t. to Tick Unit calculation, but we do not want to completely program our own Axis implementation (we cannot simply extend NumberAxis as it is "final").

      For example, often we do not want that ticks are at 1, 2.5, 5, but we only want them at "multiples of particular integers" like e. g. "multiples of ten" (1, 10, 100) etc. Another example are ticks which are allowed on "integers only" (1, 2, 3, 4, ...) but not on decimals.

      Hence, it would be really great to refactor that part of AutoRange strategy as an externally visible API. Our proposal would be the have:

      public void Axis.setAutoTickUnitStrategy(AutoTickUnitStrategy strategy)
      public AutoTickUnitStrategy Axis.getAutoTickUnitStragegy()

      where AutoTickunitStrategy is a @FunctionalInterface which declared as a simple factory function which produced tick units.

      Also it would be great if some default implementations would exist, like the ones explained above, as we think those are commonly used in science.

            Unassigned Unassigned
            mkarg Markus Karg
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Imported: