A discussion forum for JFreeChart (a 2D chart library for the Java platform).
-
asd
- Posts: 19
- Joined: Tue Sep 26, 2006 11:28 pm
Post
by asd » Mon Dec 06, 2010 6:05 pm
Hi Everyone,
I wanted to created a Bar Chart with Cyrillic characters in the labels (Russian). I used this method:
Code: Select all
domainAxis.setTickLabelFont(new Font("Arial", Font.PLAIN , 12));
But it does not work. I've tried with a lot of Font types, but it only shows three dots, instead of the Russian text.
Does anyone know a workaround for this?
-
skunk
- Posts: 1087
- Joined: Thu Jun 02, 2005 10:14 pm
- Location: Brisbane, Australia
Post
by skunk » Mon Dec 06, 2010 6:26 pm
That should work, assuming that the Arial font on your machine has Cyrillic glyphs (mine does). Can you try calling this
Code: Select all
domainAxis.setLabelFont(new Font("Arial", Font.PLAIN , 12));
and changing the axis label to a string containing russion text to make sure that the axis label works, even if the labels of the actual ticks apparently don't.
-
asd
- Posts: 19
- Joined: Tue Sep 26, 2006 11:28 pm
Post
by asd » Tue Dec 07, 2010 2:11 pm
Hi, thanks for the reply.
That didn't work either. But I can see the Cyrillic characters in my browser, so I believe they are installed in my computer as well.
Any other idea?
-
asd
- Posts: 19
- Joined: Tue Sep 26, 2006 11:28 pm
Post
by asd » Tue Dec 07, 2010 2:42 pm
I reinstalled the fonts and the latest version of jfreechart (just in case), and it still didn't work.
Can anyone enlighten me?
-
skunk
- Posts: 1087
- Joined: Thu Jun 02, 2005 10:14 pm
- Location: Brisbane, Australia
Post
by skunk » Tue Dec 07, 2010 3:05 pm
Did you try what I suggested in my previous post? What did your axis label display when you changed the font and text? Three dots? Or something else? Normally you would see "square boxes" for each character if the font did not contain glyphs for the character being displayed.
The reason for the ellipsis may just be that there is not enough space to display the axis tick labels. You can either
1) Reduce the size of the font
2) Reduce the number of categories in the plot
3) Increase the width of the plot.
-
asd
- Posts: 19
- Joined: Tue Sep 26, 2006 11:28 pm
Post
by asd » Tue Dec 07, 2010 3:22 pm
Hi again skunk,
I did everything you suggested, and it still didn't work. I even tried to set the title of the chart in Russian. It just shows an empty space, no dots, no squares.
Any other idea?
-
barbarius
- Posts: 74
- Joined: Tue Jul 27, 2010 9:33 am
- antibot: No, of course not.
Post
by barbarius » Wed Dec 08, 2010 12:44 pm
does it do the same with Latin letters?
-
asd
- Posts: 19
- Joined: Tue Sep 26, 2006 11:28 pm
Post
by asd » Fri Dec 10, 2010 2:06 pm
Yes, it works fine with Latin letters.
-
barbarius
- Posts: 74
- Joined: Tue Jul 27, 2010 9:33 am
- antibot: No, of course not.
Post
by barbarius » Fri Dec 10, 2010 2:12 pm
mine works fine. have you tried it with different font type(times new roman etc)?
-
asd
- Posts: 19
- Joined: Tue Sep 26, 2006 11:28 pm
Post
by asd » Fri Dec 10, 2010 2:27 pm
I have tried with Arial, Curier New, Times New Roman, Sans Serif, etc.
I have opensuse 11.
Don't know what else to try...
