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

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

Introduction

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

Prototype

@Override
public int getItemCount() 

Source Link

Document

Returns the number of items in the series.

Usage

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

/**
 * Simple test for the remove() method.// w  w w .ja v  a2 s.c o m
 */
@Test
public void testRemove() {
    YIntervalSeries s1 = new YIntervalSeries("Series 1");
    s1.add(1.0, 1.0, 1.0, 2.0);
    s1.add(2.0, 2.0, 2.0, 2.0);
    s1.add(3.0, 3.0, 3.0, 3.0);
    assertEquals(3, s1.getItemCount());

    s1.remove(new Double(2.0));
    assertEquals(new Double(3.0), s1.getX(1));

    s1.remove(new Double(1.0));
    assertEquals(new Double(3.0), s1.getX(0));
}

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

protected void addCurve(Curve curve, YIntervalSeries validSeries, YIntervalSeries invalidSeries,
        FitFunction fitFunction, double min, double max) {
    MyXYErrorRenderer renderer = (MyXYErrorRenderer) plot.getRenderer();
    Paint paint = plot.getDrawingSupplier().getNextPaint();
    addSeries(validSeries, paint, true, true);
    if (isDisplayInvalidPoints() && invalidSeries.getItemCount() > 0) {
        int idx = addSeries(invalidSeries, paint, true, false);
        float size = (float) DefaultDrawingSupplier.DEFAULT_SHAPE_SEQUENCE[0].getBounds().getWidth();
        DrawingSupplier ds = this.getDrawingSupplier();
        if (ds instanceof CurvePlotDrawingSupplier)
            size = (float) ((CurvePlotDrawingSupplier) ds).getShapeSize() / 2;
        size = (float) Math.floor((size - 1) / 2);
        renderer.setSeriesShape(idx, ShapeUtilities.createDiagonalCross(size, size));
    }/*from w  w  w . ja v a 2s.co  m*/
    if (null != fitFunction)
        try {
            YIntervalSeries functionSeries = sampleFunction2DToSeries(curve, fitFunction, min, max, getWidth(),
                    (Comparable<?>) (dataset.getSeriesCount() + 1));
            addSeries(functionSeries, paint, false, false);
        } catch (NullPointerException ex) {
            ex.printStackTrace();
        }
}