Example usage for org.jfree.data.statistics DefaultBoxAndWhiskerXYDataset getRangeBounds

List of usage examples for org.jfree.data.statistics DefaultBoxAndWhiskerXYDataset getRangeBounds

Introduction

In this page you can find the example usage for org.jfree.data.statistics DefaultBoxAndWhiskerXYDataset getRangeBounds.

Prototype

@Override
public Range getRangeBounds(boolean includeInterval) 

Source Link

Document

Returns the range of the values in this dataset's range.

Usage

From source file:org.jfree.data.statistics.DefaultBoxAndWhiskerXYDatasetTest.java

/**
 * Some checks for the getRangeBounds() method.
 *//*from ww  w.jav  a 2 s.co  m*/
@Test
public void testGetRangeBounds() {
    DefaultBoxAndWhiskerXYDataset d1 = new DefaultBoxAndWhiskerXYDataset("S");
    d1.add(new Date(1L), new BoxAndWhiskerItem(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, new ArrayList()));
    assertEquals(new Range(5.0, 6.0), d1.getRangeBounds(false));
    assertEquals(new Range(5.0, 6.0), d1.getRangeBounds(true));

    d1.add(new Date(1L), new BoxAndWhiskerItem(1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5, new ArrayList()));
    assertEquals(new Range(5.0, 6.5), d1.getRangeBounds(false));
    assertEquals(new Range(5.0, 6.5), d1.getRangeBounds(true));

    d1.add(new Date(2L), new BoxAndWhiskerItem(2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5, 9.5, new ArrayList()));
    assertEquals(new Range(5.0, 7.5), d1.getRangeBounds(false));
    assertEquals(new Range(5.0, 7.5), d1.getRangeBounds(true));
}

From source file:org.jfree.data.statistics.DefaultBoxAndWhiskerXYDatasetTest.java

/**
 * Some checks for the add() method.//from   www  .  j a v a  2  s  .co m
 */
@Test
public void testAdd() {
    DefaultBoxAndWhiskerXYDataset dataset = new DefaultBoxAndWhiskerXYDataset("S1");
    BoxAndWhiskerItem item1 = new BoxAndWhiskerItem(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, new ArrayList());
    dataset.add(new Date(33L), item1);

    assertEquals(1.0, dataset.getY(0, 0).doubleValue(), EPSILON);
    assertEquals(1.0, dataset.getMeanValue(0, 0).doubleValue(), EPSILON);
    assertEquals(2.0, dataset.getMedianValue(0, 0).doubleValue(), EPSILON);
    assertEquals(3.0, dataset.getQ1Value(0, 0).doubleValue(), EPSILON);
    assertEquals(4.0, dataset.getQ3Value(0, 0).doubleValue(), EPSILON);
    assertEquals(5.0, dataset.getMinRegularValue(0, 0).doubleValue(), EPSILON);
    assertEquals(6.0, dataset.getMaxRegularValue(0, 0).doubleValue(), EPSILON);
    assertEquals(7.0, dataset.getMinOutlier(0, 0).doubleValue(), EPSILON);
    assertEquals(8.0, dataset.getMaxOutlier(0, 0).doubleValue(), EPSILON);
    assertEquals(new Range(5.0, 6.0), dataset.getRangeBounds(false));
}