List of usage examples for org.jfree.data.time TimeSeries findValueRange
public Range findValueRange()
From source file:org.jfree.data.time.TimeSeriesTest.java
@Test public void testFindValueRange() { TimeSeries ts = new TimeSeries("Time Series"); assertNull(ts.findValueRange()); ts.add(new Year(2014), 1.0); assertEquals(new Range(1.0, 1.0), ts.findValueRange()); ts.add(new Year(2015), 2.0); assertEquals(new Range(1.0, 2.0), ts.findValueRange()); // null items are ignored ts.add(new Year(2016), null); assertEquals(new Range(1.0, 2.0), ts.findValueRange()); ts.clear();/*from ww w . j a va2 s . c om*/ assertNull(ts.findValueRange()); // if there are only null items, we get a NaNRange ts.add(new Year(2014), null); assertTrue(ts.findValueRange().isNaNRange()); }