Wrong chart when using openjdk

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Posts: 3
Joined: Fri May 06, 2016 4:13 am
antibot: No, of course not.

Wrong chart when using openjdk

Post by rong_bo » Fri May 06, 2016 1:37 pm

I guess it is a often occuring question but i really cannot find the answer.
Recenlty I port a project from Oracle JDK to Open JDK, and it used an old jfreechart 1.0.0 pre2 to save some chart such as pie chart or bar chart to PNG fiile, and it worked fine in Oracle JRE but failed in Open JRE.

After some trouble shooting, I find there are some libarayies missing, so I

1. copy libfreetype.so to openjre i386 directory,
2. copy libfontconfig.so to openjre i386 directory
3. copy libexpat.so to openjre i386 directory.

After these copy actions, jfreechart works. But the image jfreechart generated is wrong, if i switch to oracle jre, the image is right.

Here is a image link from oracle jre:

The image generated from open jre:

I'm not sure why these 2 jre are so different, and why oracle jre can handle it but open jre cannot, and many articles of internet said this problem, but nobody give the reason and answer.

Who can point me a right way to solve this issue?

BTW, i have tried to upgrade jfreechart but i met compile error.

Code: Select all

JFreeChart chart = ChartFactory.createPieChart3D(
				"", //Title
				pieDataset, //Dataset
				false, //Show legend
				true, //Use tooltips
				false //Configure chart to generate URLs?
Legend legend= Legend.createInstance(chart);
Compiler said there is no class Legend. Can anybody help with it ?

Really appreciate your help.