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

ClassCastException in BubbleChart if x-axis is a CategoryAxis

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 8
    • 7u6
    • javafx
    • JRE6, Win7 64

      The bubble chart probably makes sense only if the x-axis is a NumberAxis. Otherwise, the bubble radius is meaningless along the x-axis. However, it does not complain when I provide a CategoryAxis instead. During layouting it will run into a ClassCastException then (see below). From this point on the scene (in a JFXPanel) is frozen.

      java.lang.ClassCastException: javafx.scene.chart.CategoryAxis cannot be cast to javafx.scene.chart.NumberAxis
      at javafx.scene.chart.BubbleChart.layoutPlotChildren(BubbleChart.java:117)
      at javafx.scene.chart.XYChart.layoutChartChildren(XYChart.java:688)
      at javafx.scene.chart.Chart$1.layoutChildren(Chart.java:84)
      at javafx.scene.Parent.layout(Parent.java:1018)
      at javafx.scene.Scene.layoutDirtyRoots(Scene.java:513)
      at javafx.scene.Scene.doLayoutPass(Scene.java:484)
      at javafx.scene.Scene.access$3900(Scene.java:169)
      at javafx.scene.Scene$ScenePulseListener.pulse(Scene.java:2199)
      at com.sun.javafx.tk.Toolkit.firePulse(Toolkit.java:363)
      at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:460)
      at com.sun.javafx.tk.quantum.QuantumToolkit$9.run(QuantumToolkit.java:329)
      at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
      at com.sun.glass.ui.win.WinApplication.access$100(WinApplication.java:29)
      at com.sun.glass.ui.win.WinApplication$2$1.run(WinApplication.java:67)
      at java.lang.Thread.run(Unknown Source)

      I think this is a minor priority bug. Situation could be improved easily by throwing IllegalArgumentException when trying to set a non-number x-axis. Also, it would be good to document this requirement.

            psomashe Parvathi Somashekar (Inactive)
            wlehmann Werner Lehmann
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: