刷新 Google 图表而不重新绘制整个图表?
我正在创建一个页面,其中 JavaScript 创建随机数,然后从中绘制 Google 折线图。这个想法是数据将继续出现并且图表必须更新。我现在正在做的是为每个新数据添加重新绘制图表,这意味着每秒重新绘制整个图表 20 次。然而,这会大大减慢该过程。
我想知道的是,有没有一种方法可以向 Google Charts 添加一行并取出一行(如移位和推送)并在不重绘的情况下更新图表?
如果这不起作用,你们对实时数据可视化工具有什么建议吗?
I'm creating a page where javascript creates random numbers and then draws a Google line chart from it. the idea is that data will continue coming and the chart has to be updated. What I'm doing right now is redraw the chart for every new data addition, which means redrawing the entire chart 20 times a second. This however slows down the process considerably.
What I'm wondering is, is there a way to add a row to Google Charts and take out a row (like shift and push) and have the chart update without redrawing?
If that doesn't work do you guys have suggestions for live data visualization tools?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Google 图表是由 Google API 提供的图像。无法仅更改图像的一部分,您必须加载新图像。如果您想要变化的图表,请查看 HighCharts。它是一个 Javascript 图表包,其中包含您想要的示例。 D3也很强大,但需要更多的工作。
Google charts are images served by Google's API. There's no way to change just part of an image, you have to load a new image. If you want a chart that changes, look at HighCharts. It's a Javascript charting package that has examples like you want. D3 also is very powerful, but requires more work.