JFreeChart does not show the graph at every iteration on thread?

后端 未结 2 1410
执念已碎
执念已碎 2021-01-28 13:12

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

相关标签:
2条回答
  • 2021-01-28 13:33

    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.

    0 讨论(0)
  • 2021-01-28 13:33

    For your second question (integer axis labels instead of float), this can be handled by calling the setStandardTickUnits() method on the axis. You can pass any TickUnitSource, but easiest for you is probably NumberAxis.createIntegerTickUnits().

    0 讨论(0)
提交回复
热议问题