Example usage for org.jfree.data.general DatasetUtilities createConsolidatedPieDataset

List of usage examples for org.jfree.data.general DatasetUtilities createConsolidatedPieDataset

Introduction

In this page you can find the example usage for org.jfree.data.general DatasetUtilities createConsolidatedPieDataset.

Prototype

public static PieDataset createConsolidatedPieDataset(PieDataset source, Comparable key, double minimumPercent,
        int minItems) 

Source Link

Document

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 percentThreshold) into a single item.

Usage

From source file:org.jfree.data.general.DatasetUtilities.java

/**
 * 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".// w ww  .j  a va 2s  . c  o  m
 *
 * @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);
}