Localized Title

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

Localized Title

Post by Suprigya » Wed Oct 23, 2002 9:02 pm

Hi,

Can someone suggest how to get the localized title on the chart. I am getting the chart title from properties file which is the unicode string.

title = \u6642\u9593

On UI , I am getting this as squares, not text. How can I display the text?

Suprigya

Re: Localized Title

Post by Suprigya » Wed Oct 23, 2002 9:59 pm

I can get the yAxis title correctly by setting the font for the axis label.
How can I set the font for the main title chart, I couldn't find any method to set the font for main title

Dave Gilbert

Re: Localized Title

Post by Dave Gilbert » Wed Oct 23, 2002 10:22 pm

The JFreeChart class maintains a list of titles (since the chart can have zero, one or many titles). You can get a particular title using the getTitle(int) method. A cast is required, for example if you have a text title:

TextTitle title = (TextTitle) myChart.getTitle(0);
title.setFont(myFont);

I'm looking at making the whole title business a little easier for the next release, since the most common case is one title, and that isn't as easy as it should be.

Regards,

DG.

Suprigya

Re: Localized Title

Post by Suprigya » Wed Oct 23, 2002 10:39 pm

this worked, thanks a lot.

Locked