/** * Creates a new pie dataset based on the supplied dataset, but modified * by aggregating all the low value items (those whose value is lower * than the <code>percentThreshold</code>) into a single item with the * key "Other". * * @param source the source dataset (<code>null</code> not permitted). * @param key a new key for the aggregated items (<code>null</code> not * permitted). * @param minimumPercent the percent threshold. * * @return The pie dataset with (possibly) aggregated items. */ public static PieDataset createConsolidatedPieDataset(PieDataset source, Comparable key, double minimumPercent) { return DatasetUtilities.createConsolidatedPieDataset(source, key, minimumPercent, 2); }
/** * Creates a new PieDataset with ranked, consolidated results. * <p /> * Results are ranked by their value (ie 10 is greater than 5), so that pie slices * are in order of greatest to smallest. * <p /> * The minimum number of items will ALWAYS be displayed if there are at least that many items. * <p /> * 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 'otherKey'). * * @param source the source dataset (<code>null</code> not permitted). * @param otherKey the otherKey to represent the aggregated items. * @param minimumPercent the percent threshold (ten percent is 0.10). * @param minItems keep at least this many items (no matter how small) * @return The pie dataset with (possibly) aggregated items. */ public static PieDataset createConsolidatedSortedPieDataset(PieDataset source, Comparable otherKey, boolean sort, double minimumPercent, int minItems) { if (sort) source = createSortedPieDataset(source); if (minItems < source.getKeys().size()) { return removeZeroOthers(otherKey, DatasetUtilities.createConsolidatedPieDataset(source, otherKey, minimumPercent, 0)); } else { return source; } }
this.dataExtractOrder, pieIndex); if (this.limit > 0.0) { piedataset = DatasetUtilities.createConsolidatedPieDataset( dd, this.aggregatedItemsKey, this.limit);
if(getLimit() > 0.0) piedataset = DatasetUtilities.createConsolidatedPieDataset(dd, getAggregatedItemsKey(), getLimit());