As suggested by the previous posting in this forum, I use the following code to display both name and percentage in a pie chart.
PiePlot pp = (PiePlot)chart.getPlot();
pp.setSectionLabelType(6);
However, there is always a "-" sign in front of the percentage (such as -20%). I use the same code for a pie3D chart, it does not show the "-" sign.
Has any of you encountered the same problem?
Any help would be highly appreciated.
Joanne
Pie Chart Percentage Display Problem
Re: Pie Chart Percentage Display Problem
Hi,
I am also getting the same problem. Is it a bug? No problem while using pie3D chart.
reji
I am also getting the same problem. Is it a bug? No problem while using pie3D chart.
reji
Re: Pie Chart Percentage Display Problem
It is a bug that was fixed in CVS soon after the 0.9.2 release. See this thread for more info:
http://www.object-refinery.com/phorum-3 ... 075&t=3061
Regards,
DG.
http://www.object-refinery.com/phorum-3 ... 075&t=3061
Regards,
DG.
Re: Pie Chart Percentage Display Problem
David,
Thanks for the quick response. However, I cannot find the drawLable() method in the PiePlot class. I downloaded the latest windows version of JFreeChart from http://www.object-refinery.com/jfreechart/ ---0.9.2
Thank you for your time.
Joanne
Thanks for the quick response. However, I cannot find the drawLable() method in the PiePlot class. I downloaded the latest windows version of JFreeChart from http://www.object-refinery.com/jfreechart/ ---0.9.2
Thank you for your time.
Joanne
Re: Pie Chart Percentage Display Problem
Are you sure? Line 828 of the PiePlot.java source file...unless I've messed something up.
Regards,
DG.
Regards,
DG.
Re: Pie Chart Percentage Display Problem
David,
Sorry, drawLable() is there.
Where can I download the correct JFreeChart Jar file (corrrected PiePlot class) or I need to rejar myself?
Thanks a lot for you time.
Joanne
Sorry, drawLable() is there.
Where can I download the correct JFreeChart Jar file (corrrected PiePlot class) or I need to rejar myself?
Thanks a lot for you time.
Joanne
Re: Pie Chart Percentage Display Problem
You need to rejar yourself. Alternatively, you can set the 'direction' for the pie chart to ANTICLOCKWISE using the setDirection(int) method. This should restore the percentage labels to positive numbers.
Regards,
DG.
Regards,
DG.