清除一个系列并将其他系列保留在 JFreeChart 中

发布于 2024-12-23 22:26:13 字数 443 浏览 3 评论 0原文

我正在使用 JFreeChart 创建一个包含 6 个 TimeSeries 的图表。
问题:当我对其中一个系列调用.clear()时,所有其他系列都会被隐藏:

    this.Series1.clear();

问题:我应该做什么来清除一个系列没有其他人消失?

在对“Red”系列调用 .clear() 之前。
在此处输入图像描述

在“Red”系列上调用 .clear() 后。
在此处输入图像描述

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

像极了他 2024-12-30 22:26:13

我使用以下任一方法获得预期结果:

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

您可能需要验证每个 TimeSeries 是一个不同的实例。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文