Strange Exception

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Krazey

Strange Exception

Post by Krazey » Mon Jun 24, 2002 2:15 pm

Hi,

the following code throw an strange exception "Java.lang.ClasCastException":
and i don't find why he send this Exception.

XYPlot p=chart.getXYPlot();
p.setRangeAxis(new VerticalLogarithmicAxis());

Any idea ???

Thx for all.

David Gilbert

Re: Strange Exception

Post by David Gilbert » Mon Jun 24, 2002 2:51 pm

It's probably happening in the getXYPlot() method. This is a convenience method that casts the plot to XYPlot...it will fail if the underlying plot is not an XYPlot (for example, most of the bar charts are generated using CategoryPlot not XYPlot).

Regards,

DG.

Locked