-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
7u6
-
JRE6 Win7 64
Apparently, a StackedAreaChart expects Number as x-axis type. A ClassCastException occurs when using a CategoryAxis. After this the scene is frozen (inside a JFXPanel).
I don't see a reason why the stacked area chart would require numbers on the x-axis while the regular area chart does not. So, preferable it should work with a CategoryAxis as well. Otherwise, it makes sense to document the limitation and probably throw an IllegalArgumentException when trying to use an unsupported axis.
java.lang.ClassCastException: java.lang.Double cannot be cast to java.lang.String
at javafx.scene.chart.CategoryAxis.getDisplayPosition(CategoryAxis.java:60)
at javafx.scene.chart.StackedAreaChart.layoutPlotChildren(StackedAreaChart.java:431)
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 don't see a reason why the stacked area chart would require numbers on the x-axis while the regular area chart does not. So, preferable it should work with a CategoryAxis as well. Otherwise, it makes sense to document the limitation and probably throw an IllegalArgumentException when trying to use an unsupported axis.
java.lang.ClassCastException: java.lang.Double cannot be cast to java.lang.String
at javafx.scene.chart.CategoryAxis.getDisplayPosition(CategoryAxis.java:60)
at javafx.scene.chart.StackedAreaChart.layoutPlotChildren(StackedAreaChart.java:431)
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)
- duplicates
-
JDK-8126044 StackedAreaChart ClassCastException on CategoryAxis
-
- Resolved
-