Example usage for org.jfree.data.statistics DefaultBoxAndWhiskerCategoryDataset getItem

List of usage examples for org.jfree.data.statistics DefaultBoxAndWhiskerCategoryDataset getItem

Introduction

In this page you can find the example usage for org.jfree.data.statistics DefaultBoxAndWhiskerCategoryDataset getItem.

Prototype

public BoxAndWhiskerItem getItem(int row, int column) 

Source Link

Document

Return an item from within the dataset.

Usage

From source file:adapters.BoxSeriesCollectionAdapter.java

/**
 * Returns the range (<SPAN CLASS="MATH"><I>y</I></SPAN>-coordinates) min and max values.
 *
 * @return range min and max values./* ww  w.  j  a v a 2  s  .  c  om*/
 *
 */
public double[] getRangeBounds() {
    double max = 0, min = 0;
    DefaultBoxAndWhiskerCategoryDataset tempSeriesCollection = (DefaultBoxAndWhiskerCategoryDataset) seriesCollection;

    if (tempSeriesCollection.getColumnCount() != 0 && tempSeriesCollection.getRowCount() != 0) {
        max = tempSeriesCollection.getItem(0, 0).getMaxOutlier().doubleValue();
        min = tempSeriesCollection.getItem(0, 0).getMinOutlier().doubleValue();
    }

    for (int i = 0; i < tempSeriesCollection.getRowCount(); i++) {
        for (int j = 0; j < tempSeriesCollection.getColumnCount(); j++) {
            max = Math.max(max, tempSeriesCollection.getItem(i, j).getMaxOutlier().doubleValue());
            min = Math.min(min, tempSeriesCollection.getItem(i, j).getMinOutlier().doubleValue());
        }
    }

    double[] retour = { min, max };
    return retour;
}