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.
Compiler said there is no class Legend. Can anybody help with it ?
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); chart.setLegend(legend); legend.setAnchor(Legend.EAST);
Really appreciate your help.