How to Chart real time streaming data using AreaChart in JAVAFX 2 - Concurrency, Animation, Charting

后端 未结 2 2101
广开言路
广开言路 2021-02-19 04:46

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

2条回答
  •  日久生厌
    2021-02-19 04:57

    As jewelsea stated in his/her comment:

    This question was cross posted (and answered well) on an Oracle JavaFX forum thread.

    To summarize, the solution consisted in:

    • Turning animation off as it is designed for slower changing data so that it is animated on arrival;
    • Changing the Timeline to a AnimationTimer as it is desired to update the chart every frame in order to keep in sync with incoming data and move as smoothly as possible;
    • Fixing threading as OP did not need to extend Thread when using a Executor. Changing the creation of the executor service.

提交回复
热议问题