I am getting counter values in one class using a thread and writing JFreeChart in another thread. While executing, it works alternatively, but only shows the graph
Don't sleep on the event dispatch thread (EDT). As shown in Concurrency in Swing, use a worker thread to update the dataset on the EDT in process(). A complete example is shown here.