使用新数据集刷新的 JFreeChart XY 图表?例子?
我想学习如何学习如何使用 jfreechart 和 google 创建一些图表的一些示例。但我找不到我需要的东西。这里很好 http://www.java2s.com/Code/Java/Chart /CatalogChart.htm 但没有带有新显示值的刷新图表。
我想每隔 n 秒重新绘制一个图表,因为我用一组我想在此处显示的值更新外部 dile。 那么如何告诉 jfreechart 刷新绘制的图形并将其显示在画布上呢?
预先感谢,
安德烈亚斯
I want to learn how to learn how to create some charts with jfreechart and googlefor some examples. but I couldn't find what I need. This here is good http://www.java2s.com/Code/Java/Chart/CatalogChart.htm but doesn't have a refreshing graph with new displayed values.
I would like to redraw a chart every nth seconds because I update an external dile witha set of values I want to display here.
So how do I tell jfreechart to refresh the drawn graph and display it onthe canvas?
Thanks in advance,
Andreas
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
此示例具有已更新的图表使用 javax.swing.Timer 实例以可选择的速率。
附录:
JFreeChart
遵循 Swing separable-model MVC 的变体。ChartPanel
是一个方便的顶级视图,如以下 示例。对于世俗数据,TimeSeries
的TimeSeriesCollection
构成了一个简单的数据模型。This example features a chart that is updated at a selectable rate using an instance of
javax.swing.Timer
.Addendum:
JFreeChart
follows the Swing separable-model variation of MVC.ChartPanel
is a convenient top-level view, as seen in this example. For secular data, aTimeSeriesCollection
ofTimeSeries
makes a straightforward data model.我遇到了同样的问题,这对我有用:
I had the same issue, this worked for me: