hi all,
I am not able set my pie chart to display percentage upto 2 decimal places. So I have 0.2% or 0.3% displayed as 0%.
Is there any specific setting that I can use to configure and display decimal values in pie chart?
displaying percentage in pie chart upto 2 decimal places
-
- Posts: 5
- Joined: Thu Oct 25, 2007 4:29 pm
- Location: India
- Contact:
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
You can call setLabelGenerator() in the PiePlot class to control the section label format. If you use the StandardPieSectionLabelGenerator class, this constructor gives you control over the percentage formatting:
Code: Select all
public StandardPieSectionLabelGenerator(String labelFormat,
NumberFormat numberFormat, NumberFormat percentFormat);
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader

