I have a controller that sends lists via render(list1,list2,list3);
, and then plots the results using Flot Charts. I'd like to plot them as "real-time" charts, but I know it's a bit tricky. These lists are extracted from a database, a database that is not "finished" (as the simulation goes on, new data is added). Therefore, when I render the lists, they do not have all the values, as they only have the values at a particular instant.
I wonder what would be the easiest way to obtain this updating data. After putting so much thought, and realising that Play has nothing to do with PHP, I've had an idea, and I want to know if it is possible:
My idea is using AJAX or something similar in order to refresh the page (render again the data) every "x" seconds, and creating a "fake impression" of real-time plots. By doing that, I hope that the lists get updated and I can plot them as if it were real-time.
How can I do that in my views .html file and controller? Is there any other way of doing that without the need to refresh? Thanks!