Jqplot method and idea of dynamically drawing and folding line graph through ajax

  • 2020-03-30 00:47:34
  • OfStack

< img border = 0 SRC = "/ / files.jb51.net/file_images/article/201312/2013128172050839.jpg" >

The effect is shown in the figure, where each five-second graph is moved once (in effect, a new graph is drawn) to show the monitored CPU information.

The pastCpuInfomation function is used to display a line diagram

The updateCpuPic function removes the graph from 5 seconds ago and draws a new graph from the existing data.

The updateCpuInfomation function adds the latest point to an array that stores polylines

Then, set two timers in the interface, and let them execute updateCpuPic every 5 seconds and updateCpuInfomation every 1 minute, and the picture will move.

Related articles: