Example usage for org.jfree.data.time.ohlc OHLCSeriesCollection removeSeries

List of usage examples for org.jfree.data.time.ohlc OHLCSeriesCollection removeSeries

Introduction

In this page you can find the example usage for org.jfree.data.time.ohlc OHLCSeriesCollection removeSeries.

Prototype

public boolean removeSeries(OHLCSeries series) 

Source Link

Document

Removes the specified series from the dataset and sends a DatasetChangeEvent to all registered listeners.

Usage

From source file:org.jfree.data.time.ohlc.OHLCSeriesCollectionTest.java

/**
 * Some checks for the {@link OHLCSeriesCollection#removeSeries(int)}
 * method.//ww  w  .j  av  a2 s  . co m
 */
@Test
public void testRemoveSeries_int() {
    OHLCSeriesCollection c1 = new OHLCSeriesCollection();
    OHLCSeries s1 = new OHLCSeries("Series 1");
    OHLCSeries s2 = new OHLCSeries("Series 2");
    OHLCSeries s3 = new OHLCSeries("Series 3");
    OHLCSeries s4 = new OHLCSeries("Series 4");
    c1.addSeries(s1);
    c1.addSeries(s2);
    c1.addSeries(s3);
    c1.addSeries(s4);
    c1.removeSeries(2);
    assertTrue(c1.getSeries(2).equals(s4));
    c1.removeSeries(0);
    assertTrue(c1.getSeries(0).equals(s2));
    assertEquals(2, c1.getSeriesCount());
}

From source file:org.jfree.data.time.ohlc.OHLCSeriesCollectionTest.java

/**
 * Some checks for the/*  ww  w .  j  a  v a 2s.c o  m*/
 * {@link OHLCSeriesCollection#removeSeries(OHLCSeries)} method.
 */
@Test
public void testRemoveSeries() {
    OHLCSeriesCollection c1 = new OHLCSeriesCollection();
    OHLCSeries s1 = new OHLCSeries("Series 1");
    OHLCSeries s2 = new OHLCSeries("Series 2");
    OHLCSeries s3 = new OHLCSeries("Series 3");
    OHLCSeries s4 = new OHLCSeries("Series 4");
    c1.addSeries(s1);
    c1.addSeries(s2);
    c1.addSeries(s3);
    c1.addSeries(s4);
    c1.removeSeries(s3);
    assertTrue(c1.getSeries(2).equals(s4));
    c1.removeSeries(s1);
    assertTrue(c1.getSeries(0).equals(s2));
    assertEquals(2, c1.getSeriesCount());
}