How can I set NumberFormat (Locale) for the legend? HELP

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Elly
Posts: 19
Joined: Tue Jun 07, 2005 2:26 pm
Location: Germany
Contact:

How can I set NumberFormat (Locale) for the legend? HELP

Post by Elly » Mon Jan 16, 2006 5:07 pm

Hello,
I'm looking for the possibility to set NumberFormat to the values which are shown in the legend.
I wasn't able to find it so far.
Does anybody know???

NumberFormat nf = NumberFormat.getNumberInstance(Locale.GERMANY);
NumberFormat nfPercent = NumberFormat.getPercentInstance(Locale.GERMANY);

How can I let the legend to know about these formats???

please help!
using JFreeChart 1.0.0 rc1, Java 1.4.2

Elly
Posts: 19
Joined: Tue Jun 07, 2005 2:26 pm
Location: Germany
Contact:

Post by Elly » Tue Jan 17, 2006 9:59 am

the legend with values I have only in a pie chart. can somebody help me?
using JFreeChart 1.0.0 rc1, Java 1.4.2

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Tue Jan 17, 2006 12:50 pm

Use the setLegendLabelGenerator() method in the PiePlot class. You should be able to use a StandardPieSectionLabelGenerator, it allows you to specify the number formatter.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

Elly
Posts: 19
Joined: Tue Jun 07, 2005 2:26 pm
Location: Germany
Contact:

Post by Elly » Tue Jan 17, 2006 2:22 pm

Hi Dave,

thank you very much for the answer!!
I will try that out!

Best wishes!
using JFreeChart 1.0.0 rc1, Java 1.4.2

Locked