方案:
- 使用Highcharts普通图表,而不是HighStock
- 至少4个单独的图表
- 每个图表在10秒窗口中最多显示5,000点
- 数据以每秒250点的价格通过Websocket出现,尽管数据的速率和数量(例如,每200毫秒每4毫秒每4毫秒1分)可以优化,以适合如何最好地与HighCharts
- 旧点被推到10秒窗口之外
问题:
- 假设这是使用的理想情况是正确的吗Highcharts增强模块以提高性能?还是会数据更新的速度与BOOST的效果不佳?
- 是否有现有的highcharts示例小提琴或钢笔近似我描述的方案(例如,使用客户端上生成的模拟数据)并使用Boost模块?
- 您还有其他建议可以在此处使用HighCharts实施?
我已经准备了一个简单的性能测试。我通过每3秒使用setData
功能来更新一个带有5000个随机生成点的图表。您可以在此处找到有关此功能的参数的说明:http://api.highcharts.com/highcharts/series.setdata
boost模块的性能:http://jsfiddle.net/kkulig/7u6ozqg8/
在我的PC上输出:
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
性能没有升压模块: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中的描述)。