Example usage for org.jfree.data.xy XIntervalDataItem getX

List of usage examples for org.jfree.data.xy XIntervalDataItem getX

Introduction

In this page you can find the example usage for org.jfree.data.xy XIntervalDataItem getX.

Prototype

public Number getX() 

Source Link

Document

Returns the x-value.

Usage

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

/**
 * Some checks for the constructor.//from   ww  w. ja v  a 2 s.c  o m
 */
@Test
public void testConstructor1() {
    XIntervalDataItem item1 = new XIntervalDataItem(1.0, 2.0, 3.0, 4.0);
    assertEquals(new Double(1.0), item1.getX());
    assertEquals(2.0, item1.getXLowValue(), EPSILON);
    assertEquals(3.0, item1.getXHighValue(), EPSILON);
    assertEquals(4.0, item1.getYValue(), EPSILON);
}

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

/**
 * Returns the x-value for an item within a series.
 *
 * @param series  the series index.// w w  w .j  a  v  a  2 s . c  o  m
 * @param item  the item index.
 *
 * @return The x-value.
 */
@Override
public Number getX(int series, int item) {
    XIntervalSeries s = (XIntervalSeries) this.data.get(series);
    XIntervalDataItem di = (XIntervalDataItem) s.getDataItem(item);
    return di.getX();
}