簡體   English   中英

高圖:使用boost在大批量線圖中快速,實時地更新數據

[英]Highcharts: rapid, real-time data updates in high volume line charts using boost

場景:

  1. 使用Highcharts普通圖表,而不是Highstock
  2. 至少4個單獨的圖表,每個圖表均為折線圖
  3. 每個圖表在10秒的窗口中最多顯示5,000點
  4. 可以通過websocket以每秒250點的速度來傳輸數據,盡管可以優化數據傳輸的速率和數量(例如,每200毫秒50個點對每4毫秒1點),以適應與Highcharts配合使用的最佳方式
  5. 超出10秒窗口后,舊點將被淘汰

問題:

  1. 假設這是使用Highcharts Boost模塊改善性能的理想方案是否正確? 還是數據更新的快速性不能很好地發揮作用?
  2. 是否存在現有的Highcharts示例小提琴或鋼筆,可以近似我所描述的場景(例如,使用客戶端生成的模擬數據)並使用boost模塊?
  3. 您還可以針對在這里使用Highcharts實施提出其他建議嗎?

我准備了一個簡單的性能測試。 我每3秒使用setData函數用5000個隨機生成的點更新一個圖表。 您可以在此處找到傳遞給此函數的參數的說明: http : //api.highcharts.com/highcharts/Series.setData

提升模塊的性能: http //jsfiddle.net/kkulig/7u6ozqg8/

在我的電腦上輸出:

time with boost: 189.785888671875ms
time with boost: 109.576904296875ms
time with boost: 159.59326171875ms
time with boost: 75.766845703125ms
time with boost: 132.65625ms
time with boost: 174.887939453125ms
time with boost: 41.648193359375ms
time with boost: 54.340087890625ms
time with boost: 72.6669921875ms

不帶Boost模塊的性能: http //jsfiddle.net/kkulig/gLehoqp5/

在我的PC上輸出:

time without boost: 211.60595703125ms
time without boost: 146.89501953125ms
time without boost: 180.163818359375ms
time without boost: 156.8388671875ms
time without boost: 248.77197265625ms
time without boost: 149.34130859375ms
time without boost: 142.1357421875ms
time without boost: 189.8759765625ms
time without boost: 203.60009765625ms

答案

  • 問題1和2-如以上示例所示,在這種情況下,升壓模塊似乎運行良好。
  • 問題3-始終了解用於更新圖表的功能的工作原理(請從API中閱讀說明)。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM