Urgent, legend and label in PieChart, Can anyone help me?

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

Urgent, legend and label in PieChart, Can anyone help me?

Post by Mr.zhang » Sun Mar 27, 2005 1:16 pm

Hi all,

i use jfreechart-0.9.20 to creat pie 3D chart ,i have two questions.

1) I have to display the legend in the plot area insted of displaying it in chart area.how to do i can?

2) how to display the label without the section name. only with n% and color sample,how to do i can ?

as the image:
[img]D:\img\GraphKeyword.jpg[/img]
can anyone help me how to do that?

thanks a lot.

Guest

Post by Guest » Sun Mar 27, 2005 1:19 pm

i have failed to upload the image, i can't upload it, sorry :(

timw
Posts: 20
Joined: Fri Mar 18, 2005 12:36 pm
Location: London

Post by timw » Thu Mar 31, 2005 10:55 am

1) As far as i'm aware this isn't possible at the moment as it is a non-trivial task. You have to consider how you will shift and wrap the legend if, for example, one bar is so big that it will run into the space allocated to the legend. If you implement this i'm sure a lot of people will be very grateful.

2)

Code: Select all

plot.setLegendLabelGenerator(new StandardPieSectionLabelGenerator ("{1}%", new DecimalFormat("0.0"),new DecimalFormat("0.0") ));
Pie Label formatting
{0} = Section name
{1} = Raw value of section
{2} = percentage value of that section

Guest

thanks a lot :)

Post by Guest » Mon Apr 04, 2005 6:00 am

timw, thank you !
having seen you reply ,now i have known how to do it .
thanks a lot :)

Locked