Cannot display japanese in the chart

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
evebill
Posts: 6
Joined: Fri Jun 04, 2004 12:17 am

Cannot display japanese in the chart

Post by evebill » Fri Jun 04, 2004 12:20 am

Hi folks,

I have the following code to generate the chart jpg file. The chart looks great but it can't display the japanese at all. Why?


DefaultPieDataset dataset = new DefaultPieDataset();
dataset.setValue("\u7537\u6027", 20);
dataset.setValue("\u30A2\u30FC", 50);
dataset.setValue("\u30C6\u30A3", 30);

PiePlot3D plot = new PiePlot3D(dataset);
plot.setInsets(new Insets(0, 5, 5, 5));
plot.setToolTipGenerator(new StandardPieItemLabelGenerator());
JFreeChart chart = new JFreeChart("", new java.awt.Font("Times Roman", 0, 9), plot, true);
chart.setBackgroundPaint(java.awt.Color.white);
this.chartImage = ServletUtilities.saveChartAsJPEG(chart, width, height, session);

Thanks in advance!

Billy Ng

evebill
Posts: 6
Joined: Fri Jun 04, 2004 12:17 am

Post by evebill » Fri Jun 04, 2004 6:43 am

It is working after I installed Arial Unicode MS.

Locked