Hi,
I like to know what is the best aproach to show information in real time. By real time I mean 10 or 15 seconds.
The main idea is to get data from a database and constantly show it in a TimeSeries chart.
TIA.
Julio
Real Time Charts
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
If you display the chart in a ChartPanel, it will automatically update when the dataset is changed. So you need to write some code that uses a timer to fetch the latest values from the database periodically and insert them into the dataset...just be aware that JFreeChart is not thread-safe, so you should update the dataset from the event dispatch thread to ensure that the dataset doesn't change halfway through repainting the chart (which can cause some odd exceptions sometimes).
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader

