error changing orientation x-Axis label

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
mmm286
Posts: 9
Joined: Wed Oct 15, 2014 10:02 am
antibot: No, of course not.

error changing orientation x-Axis label

Post by mmm286 » Wed Oct 15, 2014 10:07 am

Hi,
Congratulations for these wonderfoul software.
I'm trying to rotate to put in vertical mode my label of x-Axis. I put in the code:

Code: Select all

				XYPlot plot = chart.getXYPlot();
				ValueAxis axis = plot.getRangeAxis();
				axis.setLabelAngle(Math.PI / 2.0);
But it says me:

Code: Select all

Exception in thread "Thread-12" java.lang.ClassCastException: org.jfree.chart.plot.CategoryPlot cannot be cast to org.jfree.chart.plot.XYPlot
	at org.jfree.chart.JFreeChart.getXYPlot(JFreeChart.java:857)
	at tercera.mostrarTercera(tercera.java:131)
	at UI$4.run(UI.java:484)
	at java.lang.Thread.run(Unknown Source)
Could you help me please?
Thanks and sorry for my english!

Locked