Reputation: 36
Is there a way to update a chart based on the user input on text field? I'm not familiar with both Swing and JFreeChart but I need to virtualize some data. So far I'm able to display simple graph but only with hardcoded data.
Thank you
Upvotes: 0
Views: 118
Reputation: 67300
Yes, of course that is possible. First of all, I recommend looking at Scala-Chart which is a nice wrapper around JFreeChart.
JFreeChart lets you alter and update any parameter. For example if you have a data-set, you can clear it and add new data, you can readjust the axes, etc. Here is an example from a project I'm working on, where a "series" (JFreeChart speak) is removed from a "dataset", then a new series is calculated and added again:
Upvotes: 3