Requirement- Build an animated AreaChart with real time streaming data. Maybe plot 300 data points every 1 sec.
Details- So I need to read real time streaming data from
A big performence drop could come from your data gathering. There is no reason to use an ExecutorService
and continuosly add new Threads
for execution by it in order to get repetitive data adding. You could settle for a single thread which reads/receives the data and adds it to the queue and start it by calling addToQueue.start()
. For it to work properly, you want a loop to run continously in the thread with a delay at the end of each iteration.