Chinese and Japanese languages are not correct in JfreeChat?

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
jackraj
Posts: 4
Joined: Sat Jul 06, 2013 10:51 am
antibot: No, of course not.

Chinese and Japanese languages are not correct in JfreeChat?

Post by jackraj » Sat Jul 06, 2013 11:00 am

Hi All,

I am using Ubuntu 11.04. In my web application jfreechart is correct for german,French,Portuguese...But for the chinese and japanese language the text values looks like square box. I can't able to get the solution for this problem. Please solve this problem

Thanks.

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Re: Chinese and Japanese languages are not correct in JfreeC

Post by david.gilbert » Mon Jul 08, 2013 6:29 am

You need to make sure the font you specify for the text in the chart actually has glyphs defined for the full set of Unicode characters.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

jackraj
Posts: 4
Joined: Sat Jul 06, 2013 10:51 am
antibot: No, of course not.

Re: Chinese and Japanese languages are not correct in JfreeC

Post by jackraj » Mon Jul 15, 2013 6:56 am

Hi David,

Thanks for your support. I am using the font "Lucida Grande". I am setting the font like this.
ResourceBundle bundle =ResourceBundle.getBundle("hello", Locale.);

JFreeChart jfree = ChartFactory.createStackedBarChart(bundle.getString("title"), bundle.getString("customer"), bundle.getString("services"), defaultcategorydataset, PlotOrientation.VERTICAL, false, true, false);
CategoryPlot categoryplot = (CategoryPlot)jfreechart.getPlot();
StackedBarRenderer barrend = (StackedBarRenderer)categoryplot.getRenderer();
barrend.setDrawBarOutline(false);
barrend.setBaseItemLabelsVisible(true);
barrend.setBaseItemLabelFont(new Font("Lucida Grande",Font.PLAIN,12));

Thanks,
Jack.

jackraj
Posts: 4
Joined: Sat Jul 06, 2013 10:51 am
antibot: No, of course not.

Re: Chinese and Japanese languages are not correct in JfreeC

Post by jackraj » Mon Jul 15, 2013 6:57 am

Hi David,

Thanks for your support. I am using the font "Lucida Grande". I am setting the font like this.
ResourceBundle bundle =ResourceBundle.getBundle("hello", Locale.);

JFreeChart jfree = ChartFactory.createStackedBarChart(bundle.getString("title"), bundle.getString("customer"), bundle.getString("services"), defaultcategorydataset, PlotOrientation.VERTICAL, false, true, false);
CategoryPlot categoryplot = (CategoryPlot)jfreechart.getPlot();
StackedBarRenderer barrend = (StackedBarRenderer)categoryplot.getRenderer();
barrend.setDrawBarOutline(false);
barrend.setBaseItemLabelsVisible(true);
barrend.setBaseItemLabelFont(new Font("Lucida Grande",Font.PLAIN,12));

Thanks,
Jack.

jackraj
Posts: 4
Joined: Sat Jul 06, 2013 10:51 am
antibot: No, of course not.

Re: Chinese and Japanese languages are not correct in JfreeC

Post by jackraj » Tue Jul 16, 2013 7:14 am

Hi David,

Please assist me.

Thanks,
Jack.

Locked