This tutorial will help you create real-time graphical graphs: http://bost.ocks.org/mike/path/
I would like to add some more comments:
Asynchronous data
When you plot in real time, you often get data asynchronously, so you cannot know the exact time between each "point".
- You're lucky for the line, because the
line described in the tutorial doesn't care about that. - During the long smooth transition effect, this is more difficult. The key is to set the duration as the time between the last frame and the previous one. This is also a good approximation for the following, since the network almost always has the same throughput.
Axis axis
On an ordinary line graph, it is easy to determine the region y. However, with real-time data, the value of y can often be limited. This is why I would recommend calling a function to set the y domain at each iteration. You can also create a bounding box.
Performance
When data is always added, you can be very careful that you need to delete values ββthat you no longer use, otherwise your data will become heavier and the whole animation may fall.
Christopher Chiche Apr 09 '13 at 5:31 on 2013-04-09 05:31
source share