Ariyan
Ariyan

Reputation: 15158

Clearing a series and keep others in JFreeChart

I'm using JFreeChart to create a chart that has 6 TimeSeries in it.
Problem: When I call .clear() on one of those series all others get hidden:

    this.Series1.clear();

Question: What should I do to clear a series without others disappear?

Before calling .clear() on the "Red" series.
enter image description here

After calling .clear() on the "Red" series.
enter image description here

Upvotes: 2

Views: 4507

Answers (1)

trashgod
trashgod

Reputation: 205785

I get the expected result using either of these:

dataset.removeSeries(0);
dataset.getSeries(0).clear();

You may need to verify that each TimeSeries is a distinct instance.

Upvotes: 6

Related Questions