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
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: