HI there :
i want to use Tradition chinese words to display my chart title
and the chart title display broken chinese words but the tool tips
can display Tradition chinese words normally and how to solve
this problem??? > <.... anybody can teach me thanks a lot.......
Tradition chinese word can not display normally
Re: Tradition chinese word can not display normally
As long as the font you use to display the title supports the characters you have used in the title, there should be no problem. What font are you using?
Regards,
DG
Regards,
DG
Re: Tradition chinese word can not display normally
dear david:
this is my pie chart sample code , i don't know how to use
font to display the title can u tell me how to .... thanks a lot ..
import com.jrefinery.data.DefaultPieDataset;
import com.jrefinery.chart.ChartFactory;
import com.jrefinery.chart.JFreeChart;
import com.jrefinery.chart.ChartFrame;
public class test {
public static void main(String[] args) {
// create a dataset...
DefaultPieDataset data = new DefaultPieDataset();
data.setValue("國文", new Double(43.2));
data.setValue("英文", new Double(27.9));
data.setValue("數å¸", new Double(79.5));
// create a chart...
JFreeChart chart = ChartFactory.createPieChart("圓餅圖",data,true); // legend
ChartFrame frame = new ChartFrame("Test", chart);
frame.pack();
frame.setVisible(true);
}
}
this is my pie chart sample code , i don't know how to use
font to display the title can u tell me how to .... thanks a lot ..
import com.jrefinery.data.DefaultPieDataset;
import com.jrefinery.chart.ChartFactory;
import com.jrefinery.chart.JFreeChart;
import com.jrefinery.chart.ChartFrame;
public class test {
public static void main(String[] args) {
// create a dataset...
DefaultPieDataset data = new DefaultPieDataset();
data.setValue("國文", new Double(43.2));
data.setValue("英文", new Double(27.9));
data.setValue("數å¸", new Double(79.5));
// create a chart...
JFreeChart chart = ChartFactory.createPieChart("圓餅圖",data,true); // legend
ChartFrame frame = new ChartFrame("Test", chart);
frame.pack();
frame.setVisible(true);
}
}
Re: Tradition chinese word can not display normally
Hi,
I have tried displaying Big5 chart title with:
String text = "some big5 text";
TextTitle subtitle = new TextTitle(text, new Font("Arial Unicode MS", Font.PLAIN, 12));
chart.addTitle(subtitle);
It can be displayed properly. Please note that you need to download that font, which is about 10MB....
Hope this is what you want
Rex
I have tried displaying Big5 chart title with:
String text = "some big5 text";
TextTitle subtitle = new TextTitle(text, new Font("Arial Unicode MS", Font.PLAIN, 12));
chart.addTitle(subtitle);
It can be displayed properly. Please note that you need to download that font, which is about 10MB....
Hope this is what you want
Rex
Re: Tradition chinese word can not display normally
If you use the ChartFactory class, you chart will get a title in the default font. Changing it is not simple, but it can be done. The getTitles() method in the JFreeChart class will return a list of titles (you'll probably have only one, but it is possible to have many). The main chart title is item zero in this list. You'll need to cast it to TextTitle, then you can use the setFont(...) method in the TextTitle class. Something like this:
TextTitle myTitle = (TextTitle) myChart.getTitles().get(0);
myTitle.setFont(...);
There is also this thread that talks about some changes that will be introduced in 0.9.5 to clean up this messy part of the code:
http://www.object-refinery.com/phorum-3 ... 269&t=5232
Regards,
Dave Gilbert
TextTitle myTitle = (TextTitle) myChart.getTitles().get(0);
myTitle.setFont(...);
There is also this thread that talks about some changes that will be introduced in 0.9.5 to clean up this messy part of the code:
http://www.object-refinery.com/phorum-3 ... 269&t=5232
Regards,
Dave Gilbert