Pie Chart Percentage Display Problem

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

Pie Chart Percentage Display Problem

Post by Joanne Li » Sat Jul 20, 2002 7:22 pm

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

reji

Re: Pie Chart Percentage Display Problem

Post by reji » Mon Jul 22, 2002 12:59 am

Hi,

I am also getting the same problem. Is it a bug? No problem while using pie3D chart.

reji

David Gilbert

Re: Pie Chart Percentage Display Problem

Post by David Gilbert » Mon Jul 22, 2002 11:57 am

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.

Joanne Li

Re: Pie Chart Percentage Display Problem

Post by Joanne Li » Mon Jul 22, 2002 3:33 pm

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

David Gilbert

Re: Pie Chart Percentage Display Problem

Post by David Gilbert » Mon Jul 22, 2002 3:37 pm

Are you sure? Line 828 of the PiePlot.java source file...unless I've messed something up.

Regards,

DG.

Joanne Li

Re: Pie Chart Percentage Display Problem

Post by Joanne Li » Mon Jul 22, 2002 8:07 pm

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

David Gilbert

Re: Pie Chart Percentage Display Problem

Post by David Gilbert » Wed Jul 24, 2002 9:00 am

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.

Locked