Why I got this error:
"java.lang.ClassCastException" when I use the
HorizontalNumberAxis axisN = (HorizontalNumberAxis) plot.getDomainAxis();
But I don't have the problem if I use this:
HorizontalDateAxis axis = (HorizontalDateAxis) plot.getDomainAxis();
I think I need to use the Number because the data in the x-values are numbers or what's wrong?.
Thanks,
ID.
Help !! ClassCastException
Re: Help !! ClassCastException
I forgot to tell you that I have this.
xys = new XYSeries("test XY)",true);
xys.add((double)0, (double)100);
xys.add((double)1, (double)100);
xys.add((double)2, (double)100);
xys.add((double)3, (double)100);
xys.add((double)4, (double)100);
public Object produceDataset(Map params) throws DatasetProduceException {
return new XYSeriesCollection(xys);
}
xys = new XYSeries("test XY)",true);
xys.add((double)0, (double)100);
xys.add((double)1, (double)100);
xys.add((double)2, (double)100);
xys.add((double)3, (double)100);
xys.add((double)4, (double)100);
public Object produceDataset(Map params) throws DatasetProduceException {
return new XYSeriesCollection(xys);
}
Re: Help !! ClassCastException
The domain axis will be a HorizontalDateAxis for time series charts, and a HorizontalNumberAxis for line charts or scatter plots. Did you use one of the methods in the ChartFactory class to create your chart? Take a look in the source code if you want to see what type of axis was used...
Regards,
DG
Regards,
DG