real time chart
real time chart
Is there some way to add a scroll bar to a real time graph such as the one in the Memory example. In other words as time goes on I want the option to be able to scroll back to look at data from some time ago. How would i go about implementing this???
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
You can't add a scrollbar within the chart, because the chart is just painted using Graphics2D, but you could add one outside the ChartPanel and have it modify the axis range depending on the scrollbar value. You could also use a JSlider for this purpose.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader


I dont necessarily need a scroll bar, i guess a slider would be just as good. My question is more a matter of how would I go about implementing the functionality of being able to view real time data that has already scrolled past the end of the screen. Suppose you have time on the x axis and you are able to display 60 seconds of data on the screen, after 60 seconds the display will show only the most recent 60 seconds of data. i want to be able to scroll (or use a slider) to go back and look at the other data. How could this be implemented, couuld you give me any general ideas. thanks. mike
-
- Posts: 43
- Joined: Fri Mar 14, 2003 3:14 pm
- Location: Porto (Portugal)
- Contact:
Hi!
See this:
http://www.jfree.org/phpBB2/viewtopic.p ... hlight=pan
I think that you can have that effect by using that example and by zooming the chart before plotting the samples. While zoomed you will see the chart updating in realtime. At some point, when you need to go back, you "pause" the chart (turn off the dataset event listeners) and use the scrool bar to go back and see the previous sample history.
Regards,
Eduardo
See this:
http://www.jfree.org/phpBB2/viewtopic.p ... hlight=pan
I think that you can have that effect by using that example and by zooming the chart before plotting the samples. While zoomed you will see the chart updating in realtime. At some point, when you need to go back, you "pause" the chart (turn off the dataset event listeners) and use the scrool bar to go back and see the previous sample history.
Regards,
Eduardo