简体   繁体   English

刷新Google图表而不重绘整个图表?

[英]Refresh Google Charts without redrawing the entire chart?

I'm creating a page where javascript creates random numbers and then draws a Google line chart from it. 我正在创建一个页面,其中javascript创建随机数,然后从中绘制Google折线图。 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. 我现在正在做的是为每个新添加的数据重绘图表,这意味着每秒重绘整个图表20次。 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? 我想知道的是,有没有一种方法可以向Google图表添加一行并取出一行(如shift和push),并在不重绘的情况下更新图表?

If that doesn't work do you guys have suggestions for live data visualization tools? 如果那行不通,你们对实时数据可视化工具有建议吗?

Google charts are images served by Google's API. Google图表是Google 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. 如果要更改图表,请查看HighCharts。 It's a Javascript charting package that has examples like you want. 这是一个Javascript图表软件包,其中包含您想要的示例。 D3 also is very powerful, but requires more work. D3也非常强大,但是需要更多工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM