Selectively displaying the legends in Pie charts

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
piyush
Posts: 4
Joined: Sat Jul 02, 2005 6:35 pm

Selectively displaying the legends in Pie charts

Post by piyush » Mon May 29, 2006 4:01 pm

Hi All,
I have a requirement where I want to show the legends of a Pie chart Selectively. i.e, if my Pie chart has 10 sections, I want to show only the first 5 legends. Is that Possible. If yes, please guide me.

Thanks in advance,
Regards,
Piyush

skunk
Posts: 1087
Joined: Thu Jun 02, 2005 10:14 pm
Location: Brisbane, Australia

Post by skunk » Mon May 29, 2006 4:11 pm

Subclass the plot and override this method

Code: Select all

public LegendItemCollection getLegendItems()
to only return the items you need

Locked