Code: Select all
CategoryDataset dataset = DatasetUtilities.createCategoryDataset(
"Series ", "Type ", new double[][] {
{1.0, 4.0, 3.0, 5.0, 5.0, 7.0, 7.0, 8.0 },
{5.0, 7.0, 6.0, 8.0, 4.0, 4.0, 2.0, 1.0 },
{4.0, 3.0, 2.0, 3.0, 6.0, 3.0, 4.0, 3.0 }
}
);
final JFreeChart chart = ChartFactory.createStackedAreaChart(
"Stacked Area Chart", // chart title
"Category", // domain axis label
"Value", // range axis label
dataset, // data
PlotOrientation.VERTICAL, // orientation
true, // include legend
true,
false
);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ChartUtilities.writeChartAsPNG(baos, chart, 1000, 450);
baos.close();
byte[] imageData = baos.toByteArray();
return imageData;

I haven't found any posts about similar problems. Could it be the way the chart is rendered?
edit:
I just tried the exact example code, with the ChartPanel and everything, and got this:

By the way, I got the problem with 1.0.6, but upgrading to 1.0.10 and jcommon-1.0.13 didn't change anything.
edit:
Also, the error appears on both Java 1.5.0_15 and 1.6.0_07