Java Code Examples for org.jfree.data.xy.XYIntervalSeries#setMaximumItemCount()

The following examples show how to use org.jfree.data.xy.XYIntervalSeries#setMaximumItemCount() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: XYIntervalSeriesTests.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * A simple check that the maximumItemCount attribute is working.
 */
public void testSetMaximumItemCount() {
    XYIntervalSeries s1 = new XYIntervalSeries("S1");
    assertEquals(Integer.MAX_VALUE, s1.getMaximumItemCount());
    s1.setMaximumItemCount(2);
    assertEquals(2, s1.getMaximumItemCount());
    s1.add(1.0, 1.1, 1.1, 1.1, 1.1, 1.1);
    s1.add(2.0, 2.2, 2.2, 2.2, 2.2, 2.2);
    s1.add(3.0, 3.3, 3.3, 3.3, 3.3, 3.3);
    assertEquals(2.0, s1.getX(0).doubleValue(), EPSILON);
    assertEquals(3.0, s1.getX(1).doubleValue(), EPSILON);
}
 
Example 2
Source File: XYIntervalSeriesTests.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Check that the maximum item count can be applied retrospectively.
 */
public void testSetMaximumItemCount2() {
    XYIntervalSeries s1 = new XYIntervalSeries("S1");
    s1.add(1.0, 1.1, 1.1, 1.1, 1.1, 1.1);
    s1.add(2.0, 2.2, 2.2, 2.2, 2.2, 2.2);
    s1.add(3.0, 3.3, 3.3, 3.3, 2.2, 2.2);
    s1.setMaximumItemCount(2);
    assertEquals(2.0, s1.getX(0).doubleValue(), EPSILON);
    assertEquals(3.0, s1.getX(1).doubleValue(), EPSILON);
}
 
Example 3
Source File: XYIntervalSeriesTests.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * A simple check that the maximumItemCount attribute is working.
 */
public void testSetMaximumItemCount() {
    XYIntervalSeries s1 = new XYIntervalSeries("S1");
    assertEquals(Integer.MAX_VALUE, s1.getMaximumItemCount());
    s1.setMaximumItemCount(2);
    assertEquals(2, s1.getMaximumItemCount());
    s1.add(1.0, 1.1, 1.1, 1.1, 1.1, 1.1);
    s1.add(2.0, 2.2, 2.2, 2.2, 2.2, 2.2);
    s1.add(3.0, 3.3, 3.3, 3.3, 3.3, 3.3);
    assertEquals(2.0, s1.getX(0).doubleValue(), EPSILON);
    assertEquals(3.0, s1.getX(1).doubleValue(), EPSILON);
}
 
Example 4
Source File: XYIntervalSeriesTests.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Check that the maximum item count can be applied retrospectively.
 */
public void testSetMaximumItemCount2() {
    XYIntervalSeries s1 = new XYIntervalSeries("S1");
    s1.add(1.0, 1.1, 1.1, 1.1, 1.1, 1.1);
    s1.add(2.0, 2.2, 2.2, 2.2, 2.2, 2.2);
    s1.add(3.0, 3.3, 3.3, 3.3, 2.2, 2.2);
    s1.setMaximumItemCount(2);
    assertEquals(2.0, s1.getX(0).doubleValue(), EPSILON);
    assertEquals(3.0, s1.getX(1).doubleValue(), EPSILON);
}