How to replace legend (to east side) in piechart ??

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
onderulker
Posts: 13
Joined: Mon May 22, 2006 3:01 pm

How to replace legend (to east side) in piechart ??

Post by onderulker » Wed May 24, 2006 1:10 pm

Hi all,

I want to display legend east side of the chart. But I could not find any way for doing this.

Is there any one have an idea?

Regards,

Onder.

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 » Wed May 24, 2006 1:34 pm

The LegendTitle class inherits the setPosition(RectangleEdge) method from the Title class. You can use this to change the position of the legend at any time.
David Gilbert
JFreeChart Project Leader

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

onderulker
Posts: 13
Joined: Mon May 22, 2006 3:01 pm

Post by onderulker » Wed May 24, 2006 3:18 pm

Thanks a lot, it has done.

Now I have a new question;
I am trying to customize my pie charts labels. For example lable of charts part is 'SCM = 3%'. I want to show just the value '3%'. I have searced about this and find this:

public String generateSectionLabel(final PieDataset dataset, final Comparable key)
{
String result = null;
if (dataset != null) {
if (!key.equals("PHP")) {
result = key.toString();
}
}
return result;
}

Result is 'SCM' not '3%'. How could I correct this.

Regards,

Onder.

Locked