Hey all,
Is there a way to display unicode (eg.chinese) in the series name and title in bar chart using jfreechart .... if there is a way, can you tell me how to do that ?
thankyou
rgds,
karsin
to display unicode in jfreechart
Re: to display unicode in jfreechart
You get the full Java support for Unicode, since JFreeChart is just using String object to represent text. The main thing you need to watch out for is whether or not the font you are using actually supports the Unicode characters you are trying to display. Most fonts don't support the full range of Unicode characters.
Regards,
Dave Gilbert
Regards,
Dave Gilbert
Re: to display unicode in jfreechart
Hi David,
Thanks for your reply, please I cannot really understand what you saying, can you explain in detail. Can you give me an example, below is my code, there is some chinese word in it, but when i save a file, it says ANSI, cannot contain any unicode, when i change to unicode , java compailer doesn't allow me to compile.please help
JFreeChart chart;
try {
chart = ChartFactory.createVerticalBarChart("Message Sent ĪÎÄε-Ê¢ÏĵĹûʵ/ Received Chart","Day/Week/Month","Messages",categoryData, true);
chart.setBackgroundPaint(new GradientPaint(0, 0, getColor( initGradColor ), 1000, 0, getColor( finalGradColor )));
CategoryPlot plot = chart.getCategoryPlot();
HorizontalCategoryAxis axis = (HorizontalCategoryAxis)plot.getDomainAxis();
axis.setVerticalCategoryLabels(true);
return chart;
}
catch (Exception e) {
return null;
}
rgds,
Karsin
Thanks for your reply, please I cannot really understand what you saying, can you explain in detail. Can you give me an example, below is my code, there is some chinese word in it, but when i save a file, it says ANSI, cannot contain any unicode, when i change to unicode , java compailer doesn't allow me to compile.please help
JFreeChart chart;
try {
chart = ChartFactory.createVerticalBarChart("Message Sent ĪÎÄε-Ê¢ÏĵĹûʵ/ Received Chart","Day/Week/Month","Messages",categoryData, true);
chart.setBackgroundPaint(new GradientPaint(0, 0, getColor( initGradColor ), 1000, 0, getColor( finalGradColor )));
CategoryPlot plot = chart.getCategoryPlot();
HorizontalCategoryAxis axis = (HorizontalCategoryAxis)plot.getDomainAxis();
axis.setVerticalCategoryLabels(true);
return chart;
}
catch (Exception e) {
return null;
}
rgds,
Karsin