Problem in java local
-
- Posts: 58
- Joined: Mon Dec 15, 2008 7:07 am
- Location: India
- Contact:
Problem in java local
Hi,
I want to display charts for different languages( say japanese).
I have a property file from where i can set the Locals. for japanese i have set
Local=jp_JP
but when i generate charts it gives me junk chars... i have changed browser(mozilla/IE 6) encoding to UTF-8.(i can see other text, other then chart in proper way).
I am using jre1.5.0 (sun) in Suse 10.0 O/S.
Do i need to install any language package?
i have psfont.properties.ja file in my jre/lib/
I want to display charts for different languages( say japanese).
I have a property file from where i can set the Locals. for japanese i have set
Local=jp_JP
but when i generate charts it gives me junk chars... i have changed browser(mozilla/IE 6) encoding to UTF-8.(i can see other text, other then chart in proper way).
I am using jre1.5.0 (sun) in Suse 10.0 O/S.
Do i need to install any language package?
i have psfont.properties.ja file in my jre/lib/
Abhay Singh
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
Re: Problem in java local
Most likely Java is using a different font to your browser...and the font the browser is using supports the Japanese characters you want to display, while the font that Java is using doesn't.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader


-
- Posts: 58
- Joined: Mon Dec 15, 2008 7:07 am
- Location: India
- Contact:
Re: Problem in java local
Hi,
I think you are right, i wrote the map file for the chart created and if view that map file in any editer then i found junk chars where i need
text in new language.
but when i checked my log file i found that its taking correct locale
I used this to set locale
and my log file entries is
INFO Graphserver:78:main Locale=ja_JP: 日本語
where in chart it showes like this
http://www.postimage.org/image.php?v=aVMKiwr
(check legends and text above legend)
What should i do to make this working..? i am not getting any idea...
I think you are right, i wrote the map file for the chart created and if view that map file in any editer then i found junk chars where i need
text in new language.
but when i checked my log file i found that its taking correct locale
I used this to set locale
Code: Select all
Locale locales = new Locale("ja", "JP");
Locale.setDefault(new Locale("ja", "JP"));
String displayLanguage = locales.getDisplayLanguage(locales);
log.info("Locale="+locales.toString() + ": " + displayLanguage);
INFO Graphserver:78:main Locale=ja_JP: 日本語
where in chart it showes like this
http://www.postimage.org/image.php?v=aVMKiwr
(check legends and text above legend)
What should i do to make this working..? i am not getting any idea...
Abhay Singh
-
- Posts: 58
- Joined: Mon Dec 15, 2008 7:07 am
- Location: India
- Contact:
Re: Problem in java local
Hi,
Can any one please help me in this, i have tried all option i came across like,
Changing the charcterset of stored data... (utf8)
passing charcterEncoding in jdbcURL while making connection to data base for fetching data... (utf8)
Setting LOCALE for my programme...
Please help me..
Can any one please help me in this, i have tried all option i came across like,
Changing the charcterset of stored data... (utf8)
passing charcterEncoding in jdbcURL while making connection to data base for fetching data... (utf8)
Setting LOCALE for my programme...
Please help me..
Abhay Singh
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
Re: Problem in java local
As I said, Java is using a font that doesn't include glyphs for the characters you want to display. Change the font to one with better unicode support, and you'll see the characters you are expecting.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader


-
- Posts: 58
- Joined: Mon Dec 15, 2008 7:07 am
- Location: India
- Contact:
Re: Problem in java local
Hi,
I am useing org.jfree.chart.ChartFactory functions like createBarChart etc..
and there is no options to pass fonts , in this case i need to wirte functions for tooltip, legends and labels seperatly right?
I am useing org.jfree.chart.ChartFactory functions like createBarChart etc..
and there is no options to pass fonts , in this case i need to wirte functions for tooltip, legends and labels seperatly right?
Abhay Singh
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
Re: Problem in java local
You have different options:
(1) Change the default font for the JVM:
http://java.sun.com/javase/technologies ... -rendering
(2) Create a new ChartTheme with the font you want, and apply that to your charts (then you won't have to change each and every font attribute in the chart structure);
(3) Go through the chart structure and change each font attribute individually.
Note that if you are coding a Swing application, the tool tip font is controlled by the look and feel, not JFreeChart.
(1) Change the default font for the JVM:
http://java.sun.com/javase/technologies ... -rendering
(2) Create a new ChartTheme with the font you want, and apply that to your charts (then you won't have to change each and every font attribute in the chart structure);
(3) Go through the chart structure and change each font attribute individually.
Note that if you are coding a Swing application, the tool tip font is controlled by the look and feel, not JFreeChart.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader


-
- Posts: 7
- Joined: Thu Mar 13, 2014 12:22 pm
- antibot: No, of course not.
Re: Problem in java local
Even I am creating chart by following method.
chart = ChartFactory.createBarChart3D(..);
then in my dataset having language of Japanese,Hindi,Chinese..etc..how can i support to have the chart display all the language as with the tables like the java locales.
???
please help
Thanks in advance.
chart = ChartFactory.createBarChart3D(..);
then in my dataset having language of Japanese,Hindi,Chinese..etc..how can i support to have the chart display all the language as with the tables like the java locales.
???
please help
Thanks in advance.