Localization

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

Localization

Post by Brian Schoenhofer » Fri Dec 20, 2002 7:30 pm

Does JFreeChart support localization of numbers displayed on the X-Y Axis?
Specifically I need to be able to view charts using $###,###.00 for English and ### ###,00 $ for French.

Thanks.
Brian

David Gilbert

Re: Localization

Post by David Gilbert » Mon Dec 23, 2002 10:24 am

Hi Brian,

I haven't figured out a good way to do this yet. You'll see a method createStandardTickUnits() in the NumberAxis class (and a similar method in the DateAxis class). The formats are coded in there, but don't take into account localisation...one problem is that I use a different format for different tick sizes, so I can't just grab a localised format from the NumberFormat class.

I'm happy to hear suggestions for an improved approach. One idea I've considered is putting the eleven unique number formats into the resource bundles and reading them from there, that might work...

Regards,

Dave Gilbert

Locked