ClassCastException: com.jrefinery.data.XYSeriesCollection

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

ClassCastException: com.jrefinery.data.XYSeriesCollection

Post by VK » Tue Nov 26, 2002 4:14 pm

jFreeChart 0.9.4 :

I'm trying to create a CombinedXYPlot using two subplots as follows :

...
CombinedXYPlot plot = new CombinedXYPlot(
new HorizontalDateAxis("Date"),
CombinedXYPlot.VERTICAL);

for (int i = 0; i < m_XYPlotArray.size(); i++) {
plot.add((XYPlot)m_XYPlotArray.get(i), 2);
}
...

The first subplots has two series and the second one has one series populated as :

XYSeriesCollection dataset = new XYSeriesCollection();

dataset.addSeries(...);

The subplots seem to be added correctly, but the following line raises a ClassCastException:

-> ChartUtilities.saveChartAsPNG(m_file, m_chart, 400, 300, m_info);

[[java.lang.ClassCastException: com.jrefinery.data.XYSeriesCollection]]

In debug mode, the m_file/m_chart and m_info objects display expected values.


Am I missing something?

Thanks,
VK

Dave Gilbert

Re: ClassCastException: com.jrefinery.data.XYSeriesCollectio

Post by Dave Gilbert » Wed Nov 27, 2002 1:29 pm

It sounds like a bug. Can you post a small sample application that replicates the problem?

Regards,

DG

Locked