I'm trying to upgrade my code form 0.9.4 to 0.9.6 and an getting some weird errors when trying to run something really basic.
String mainTitle = "Main Title";
String xTitle = "X Title";
String yTitle = "Y Title";
double[][] data = {{1,2,3},{4,5,6},{7,8,9}};
DefaultCategoryDataset dataset = new DefaultCategoryDataset();
for (int i=0; i<data.length; i++)
{
for (int j=0; j<data[0].length; j++)
{
dataset.addValue(data[j], new Double(i), new Double(j));
}
}
JFreeChart chart = ChartFactory.createVerticalBarChart3D(mainTitle, xTitle, yTitle, dataset, true,true,true);
chart.setBackgroundPaint(Color.white);
Legend legend = chart.getLegend();
legend.setAnchor(Legend.EAST);
chart.setLegend(legend);
try {
File f = new File("/tmp/image.jpg");
FileOutputStream fos = new FileOutputStream(f);
ChartUtilities.writeChartAsJPEG(fos, chart, 750, 200);
fos.flush();
fos.close();
} catch (IOException ioe) {
System.out.println(ioe);
}
Gives me the following error. Any help would be greatly appreciated.
bash-2.03$ java imageOut
Exception in thread "main" java.lang.NoClassDefFoundError: com/jrefinery/ui/Drawable
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:509)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:246)
at java.net.URLClassLoader.access$100(URLClassLoader.java:54)
at java.net.URLClassLoader$1.run(URLClassLoader.java:193)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)
at java.lang.ClassLoader.loadClass(ClassLoader.java:262)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:322)
at com.jrefinery.chart.ChartFactory.createVerticalBarChart3D(Unknown Source)
at imageOut.main(imageOut.java:31)
bash-2.03$
Possible bug when creating chart
Re: Possible bug when creating chart
Never mind. :/
Helps to have the latest jcommon IN the classpath.
Thanks anyway,
jweber
Helps to have the latest jcommon IN the classpath.

Thanks anyway,
jweber