JFreeChart - 创建移动图表时出现问题

问题描述:

我在我的java应用程序中使用JFreeChart。

I am using JFreeChart in my java application.

问题

我想绘制 XYAreaChart ,当我们开始绘制数据时,域轴(x轴)应自动水平滚动。

I want to plot a XYAreaChart whose domain axis (x-axis) should scroll horizontally automatically when we start plotting the data.

我在 TimeSeriesCharts 中看到了相同的内容,但我不想要任何timeSeriesChart。我只想要滚动的x轴。

I saw the same thing in TimeSeriesCharts but I don't want any timeSeriesChart. I just want the scrolling x-axis.

你需要创建自己的 SlidingXYDataset 实现 XYDataset 的方式类似于 SlidingCategoryDataset 实现 CategoryDataset

You'll need to create your own SlidingXYDataset that implements XYDataset in a manner similar to how SlidingCategoryDataset implements CategoryDataset.

附录:如评论中所述,可以在这里找到实施。

Addendum: As noted in a comment, a typical implementation can be found here.