com.atlassian.jira.charts.jfreechart.util
Class PieDatasetUtil

java.lang.Object
  extended by com.atlassian.jira.charts.jfreechart.util.PieDatasetUtil

public class PieDatasetUtil
extends Object

Utilities to manipulate datasets

Since:
v4.0

Constructor Summary
PieDatasetUtil()
           
 
Method Summary
static org.jfree.data.general.PieDataset createConsolidatedSortedPieDataset(org.jfree.data.general.PieDataset source, Comparable key, boolean sort, double minimumPercent, int minItems)
          Creates a new PieDataset with ranked, consolidated results.
static org.jfree.data.general.PieDataset createSortedPieDataset(org.jfree.data.general.PieDataset source)
          Sort a pie dataset by it's values (highest to lowest)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PieDatasetUtil

public PieDatasetUtil()
Method Detail

createConsolidatedSortedPieDataset

public static org.jfree.data.general.PieDataset createConsolidatedSortedPieDataset(org.jfree.data.general.PieDataset source,
                                                                                   Comparable key,
                                                                                   boolean sort,
                                                                                   double minimumPercent,
                                                                                   int minItems)
Creates a new PieDataset with ranked, consolidated results.

Results are ranked by their value (ie 10 is greater than 5), so that pie slices are in order of greatest to smallest.

The minimum number of items will ALWAYS be displayed if there are at least that many items.

If there are more than the minimum number of items, once ranked any items smaller than the minimumPercent are consolidated into an "Other" entity (named by 'key').

Parameters:
source - the source dataset (null not permitted).
key - the key to represent the aggregated items.
sort -
minimumPercent - the percent threshold (ten percent is 0.10).
minItems - keep at least this many items (no matter how small)
Returns:
The pie dataset with (possibly) aggregated items.

createSortedPieDataset

public static org.jfree.data.general.PieDataset createSortedPieDataset(org.jfree.data.general.PieDataset source)
Sort a pie dataset by it's values (highest to lowest)

Parameters:
source - the source dataset (null not permitted).
Returns:
The pie dataset with sorted items.


Copyright © 2002-2012 Atlassian. All Rights Reserved.