to display unicode in jfreechart

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
karsin

to display unicode in jfreechart

Post by karsin » Mon Feb 17, 2003 7:49 am

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

David Gilbert

Re: to display unicode in jfreechart

Post by David Gilbert » Mon Feb 17, 2003 7:54 am

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

karsin

Re: to display unicode in jfreechart

Post by karsin » Mon Feb 17, 2003 12:05 pm

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

Locked