Grouping minor/insignificant values of a Pie Chart

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
pelski
Posts: 16
Joined: Thu Feb 23, 2006 2:02 am

Grouping minor/insignificant values of a Pie Chart

Post by pelski » Mon Mar 13, 2006 4:03 am

Hi,

Has jfree chart implemented a heuristic that will group segments of a
pie chart that are too small or insignificant to dedicate an entire segment and
label for?

For example, say I have a dataset of 100 values to draw, I would only like to show the top 10 values separately. The others would be grouped together in a single segment titled 'other'. Is there a means to do this?

Cheers,
Nick

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 » Mon Mar 13, 2006 12:12 pm

The DatasetUtilities class has a createConsolidatedPieDataset() method that does something along these lines. You need to apply it to the original dataset - it will return a new dataset that you add to the plot.

Possibly the PiePlot class could be extended to support this more directly.
David Gilbert
JFreeChart Project Leader

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

Locked