public class

PieDatasetUtil

extends Object
java.lang.Object
   ↳ com.atlassian.jira.charts.jfreechart.util.PieDatasetUtil

Class Overview

Utilities to manipulate datasets

Summary

Public Constructors
PieDatasetUtil()
Public Methods
static PieDataset createConsolidatedSortedPieDataset(PieDataset source, Comparable key, boolean sort, double minimumPercent, int minItems)
Creates a new PieDataset with ranked, consolidated results.
static PieDataset createSortedPieDataset(PieDataset source)
Sort a pie dataset by it's values (highest to lowest)
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public PieDatasetUtil ()

Public Methods

public static PieDataset createConsolidatedSortedPieDataset (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.
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.

public static PieDataset createSortedPieDataset (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.