Help needed in implementing the spreadEvenly() in PieLabel

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
SwethaKrish
Posts: 13
Joined: Tue Jun 19, 2007 6:03 am

Help needed in implementing the spreadEvenly() in PieLabel

Post by SwethaKrish » Fri Dec 26, 2008 10:05 am

Hi I am using jfree to create pie chart where i have nearly 15 values in the pie chart. When the chart is drawn some of the labels are displayed completely..

so I would like to have the pie labels distributed evenly so that all the labels are visible..

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 Dec 30, 2008 11:35 am

Can you post an example and describe in more detail what you mean by "spread evenly"?

Depending on your dataset, most of the labels might end up on one side of the pie...in that case, you could manually fix that by calling setStartAngle() in the PiePlot class (I'm considering adding an option to have the PiePlot class do this automatically to ensure that half the labels end up on one side and half on the other).
David Gilbert
JFreeChart Project Leader

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

SwethaKrish
Posts: 13
Joined: Tue Jun 19, 2007 6:03 am

Post by SwethaKrish » Tue Dec 30, 2008 3:29 pm

Here my dataset has maximum of 10 values and these values are random..

The issue here is say
value A - 20 %
value B - 20 %
value C - 20 %
value D - 11 %
value E - 7%
value F - 5 %
value G - 4 %
value I - 1 %
value J - 1 %


The start angle of my chart is 45 degree. Though the percentage for each values are random. So in the final output..I see the last 2 legends get hided..I can see only the label markings and no the legends...

In some cases i get the dataset where the first value has 98 % and all the remaining 9 as below 2 %....

Is there any way to get all the legends visible .

Locked