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

[Chart] CategoryAxis needs a string converter for display

XMLWordPrintable

      CategoryAxis extends Axis<String> without the option to format/replace the string for presentation. Since the string is the "key" for the axis it is essentially an ID. So now we have an ID that is also the presented String.

      I don't think I have to explain why this is troublesome.

      It can be partly fixed by setting a Function<String, String> that can transform the key to a presentation string. (Please don't use StringConverter as it is two-way and not lambda friendly. You do need to solve this once and for all anyway since I have seen that you inappropriately use StringConverter in other places.)

      Of course, the real solution for the axis would be to make a new CategoryAxis that didn't enforce the type to be String and also have a converter Function<T, String>.

            Unassigned Unassigned
            mgrev Mikael Grev
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Imported: