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

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

Introduction

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

Prototype

public static Range findRangeBounds(XYDataset dataset, boolean includeInterval) 

Source Link

Document

Returns the range of values in the range for the dataset.

Usage

From source file:org.jfree.data.xy.DefaultOHLCDatasetTest.java

/**
 * A small test for the data range calculated on this dataset.
 *///from   w  w  w. j ava2s . com
@Test
public void testDataRange() {
    OHLCDataItem[] data = new OHLCDataItem[3];
    data[0] = new OHLCDataItem(new Date(11L), 2.0, 4.0, 1.0, 3.0, 100.0);
    data[1] = new OHLCDataItem(new Date(22L), 4.0, 9.0, 2.0, 5.0, 120.0);
    data[2] = new OHLCDataItem(new Date(33L), 3.0, 7.0, 3.0, 6.0, 140.0);
    DefaultOHLCDataset d = new DefaultOHLCDataset("S1", data);
    Range r = DatasetUtilities.findRangeBounds(d, true);
    assertEquals(1.0, r.getLowerBound(), EPSILON);
    assertEquals(9.0, r.getUpperBound(), EPSILON);
}

From source file:org.jfree.data.xy.junit.DefaultOHLCDatasetTest.java

/**
 * A small test for the data range calculated on this dataset.
 *///from   w w w  . j  av a  2s.  c  o m
public void testDataRange() {
    OHLCDataItem[] data = new OHLCDataItem[3];
    data[0] = new OHLCDataItem(new Date(11L), 2.0, 4.0, 1.0, 3.0, 100.0);
    data[1] = new OHLCDataItem(new Date(22L), 4.0, 9.0, 2.0, 5.0, 120.0);
    data[2] = new OHLCDataItem(new Date(33L), 3.0, 7.0, 3.0, 6.0, 140.0);
    DefaultOHLCDataset d = new DefaultOHLCDataset("S1", data);
    Range r = DatasetUtilities.findRangeBounds(d, true);
    assertEquals(1.0, r.getLowerBound(), EPSILON);
    assertEquals(9.0, r.getUpperBound(), EPSILON);
}

From source file:edu.scripps.fl.curves.plot.MyXYErrorRenderer.java

public Range findRangeBounds(XYDataset dataset) {
    if (dataset != null)
        return DatasetUtilities.findRangeBounds(dataset, true);
    else//from w w w  .ja v a  2  s . c  o m
        return null;
}

From source file:anl.verdi.plot.jfree.XYBlockRenderer.java

/**
 * Returns the range of values the renderer requires to display all the
 * items from the specified dataset./*  ww  w .  j ava  2 s. c  o  m*/
 *
 * @param dataset the dataset (<code>null</code> permitted).
 * @return The range (<code>null</code> if the dataset is <code>null</code>
 *         or empty).
 */
public Range findRangeBounds(XYDataset dataset) {
    if (dataset != null) {
        Range r = DatasetUtilities.findRangeBounds(dataset, false);
        return new Range(r.getLowerBound() + yOffset, r.getUpperBound() + blockHeight + yOffset);
    } else {
        return null;
    }
}

From source file:nl.vu.nat.jfreechartcustom.XYBlockRenderer.java

/**
 * Returns the range of values the renderer requires to display all the
 * items from the specified dataset./*from   ww  w .  ja v a2 s. c  o m*/
 *
 * @param dataset  the dataset (<code>null</code> permitted).
 *
 * @return The range (<code>null</code> if the dataset is <code>null</code>
 *         or empty).
 *
 * @see #findDomainBounds(XYDataset)
 */
public Range findRangeBounds(XYDataset dataset) {
    if (dataset != null) {
        Range r = DatasetUtilities.findRangeBounds(dataset, false);
        if (r == null) {
            return null;
        } else {
            return new Range(r.getLowerBound() + this.yOffset,
                    r.getUpperBound() + this.blockHeight + this.yOffset);
        }
    } else {
        return null;
    }
}

From source file:edu.dlnu.liuwenpeng.render.CandlestickRenderer.java

/**    
* Returns the range of values the renderer requires to display all the    
* items from the specified dataset.    //from   w ww.  j  av a  2s .  co m
*    
* @param dataset  the dataset (<code>null</code> permitted).    
*    
* @return The range (<code>null</code> if the dataset is <code>null</code>    
*         or empty).    
*/
public Range findRangeBounds(XYDataset dataset) {
    if (dataset != null) {
        return DatasetUtilities.findRangeBounds(dataset, true);
    } else {
        return null;
    }
}