Example usage for org.jfree.data.xy YIntervalSeries getYValue

List of usage examples for org.jfree.data.xy YIntervalSeries getYValue

Introduction

In this page you can find the example usage for org.jfree.data.xy YIntervalSeries getYValue.

Prototype

public double getYValue(int index) 

Source Link

Document

Returns the y-value for the specified item.

Usage

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

/**
 * Returns the y-value (as a double primitive) for an item within a
 * series./*from ww w.  j av  a2 s .  com*/
 *
 * @param series  the series index (zero-based).
 * @param item  the item index (zero-based).
 *
 * @return The value.
 */
@Override
public double getYValue(int series, int item) {
    YIntervalSeries s = (YIntervalSeries) this.data.get(series);
    return s.getYValue(item);
}

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

/**
 * Returns the y-value for an item within a series.
 *
 * @param series  the series index.// w ww  . ja v a 2 s . c  o  m
 * @param item  the item index.
 *
 * @return The y-value.
 */
@Override
public Number getY(int series, int item) {
    YIntervalSeries s = (YIntervalSeries) this.data.get(series);
    return new Double(s.getYValue(item));
}

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

/**
 * When items are added with duplicate x-values, we expect them to remain
 * in the order they were added./*from  ww  w .  j a  v  a2s  . co m*/
 */
@Test
public void testAdditionOfDuplicateXValues() {
    YIntervalSeries s1 = new YIntervalSeries("Series 1");
    s1.add(1.0, 1.0, 1.0, 1.0);
    s1.add(2.0, 2.0, 2.0, 2.0);
    s1.add(2.0, 3.0, 3.0, 3.0);
    s1.add(2.0, 4.0, 4.0, 4.0);
    s1.add(3.0, 5.0, 5.0, 5.0);
    assertEquals(1.0, s1.getYValue(0), EPSILON);
    assertEquals(2.0, s1.getYValue(1), EPSILON);
    assertEquals(3.0, s1.getYValue(2), EPSILON);
    assertEquals(4.0, s1.getYValue(3), EPSILON);
    assertEquals(5.0, s1.getYValue(4), EPSILON);
}

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

/**
 * Some checks for the add() method for an UNSORTED series.
 *//*  w w w.  jav a 2 s.  com*/
@Test
public void testAdd() {
    YIntervalSeries series = new YIntervalSeries("Series", false, true);
    series.add(5.0, 5.50, 5.50, 5.50);
    series.add(5.1, 5.51, 5.51, 5.51);
    series.add(6.0, 6.6, 6.6, 6.6);
    series.add(3.0, 3.3, 3.3, 3.3);
    series.add(4.0, 4.4, 4.4, 4.4);
    series.add(2.0, 2.2, 2.2, 2.2);
    series.add(1.0, 1.1, 1.1, 1.1);
    assertEquals(5.5, series.getYValue(0), EPSILON);
    assertEquals(5.51, series.getYValue(1), EPSILON);
    assertEquals(6.6, series.getYValue(2), EPSILON);
    assertEquals(3.3, series.getYValue(3), EPSILON);
    assertEquals(4.4, series.getYValue(4), EPSILON);
    assertEquals(2.2, series.getYValue(5), EPSILON);
    assertEquals(1.1, series.getYValue(6), EPSILON);
}