Example usage for org.jfree.data.time TimePeriodValuesCollection removeSeries

List of usage examples for org.jfree.data.time TimePeriodValuesCollection removeSeries

Introduction

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

Prototype

public void removeSeries(int index) 

Source Link

Document

Removes a series from the collection.

Usage

From source file:org.jfree.data.time.TimePeriodValuesCollectionTest.java

/**
 * A test for bug report 1161340.  I wasn't able to reproduce the problem
 * with this test./* ww  w.  j  ava  2  s . c  om*/
 */
@Test
public void test1161340() {
    TimePeriodValuesCollection dataset = new TimePeriodValuesCollection();
    TimePeriodValues v1 = new TimePeriodValues("V1");
    v1.add(new Day(11, 3, 2005), 1.2);
    v1.add(new Day(12, 3, 2005), 3.4);
    dataset.addSeries(v1);
    assertEquals(1, dataset.getSeriesCount());
    dataset.removeSeries(v1);
    assertEquals(0, dataset.getSeriesCount());

    TimePeriodValues v2 = new TimePeriodValues("V2");
    v1.add(new Day(5, 3, 2005), 1.2);
    v1.add(new Day(6, 3, 2005), 3.4);
    dataset.addSeries(v2);
    assertEquals(1, dataset.getSeriesCount());
}