如何在 Google 注释时间线上使用 rangechange() 来仅获取所选范围的数据?

发布于 2024-07-12 06:37:17 字数 712 浏览 7 评论 0原文

我有大量数据点,想要使用 Google 绘制图表可视化:带注释的时间线。 我想象在 JS 中输出 100,000 个 data.setValue 点(使用与此处描述的方法类似的 PHP) 构建 DataTable 会导致性能问题。 相反,我想输出一个小数字,然后根据所选的日期范围增加。

时间线包含一个在范围更改时触发的事件 - rangechange()

当 rangechange() 方法被触发时,是否可以查询 URL 以返回该日期范围的数据,然后更新时间线以显示该数据? 执行此操作的代码是什么?

I have a large number of data points that I want to graph using the Google Visualization: Annotated Time Line. I imagine that outputting, say, 100,000 data.setValue points in JS (using PHP similar to the method described here) to build a DataTable will cause performance issues. Instead, I want to output a small number and then increase depending on the date range selected.

The time line includes an event which is triggered when the range is changed - rangechange().

When the rangechange() method is triggered, is it possible to query a URL to return the data for that date range and then update the time line to display that data? What would the code be to do this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

风启觞 2024-07-19 06:37:18

是的,

您只需向服务器发出另一个请求,以从服务器获取新的数据表(为其提供查询参数来定义您感兴趣的时间范围)。

然后将返回的数据与先前使用的数据表中的数据组合起来(使用 addRows() 方法)。

然后重新创建图表并将范围设置为创建之前的范围。

这应该会给您带来您正在寻找的效果。

  • 鲍勃·莱特

yes,

You just make another request back to the server for a new DataTable from the server (give it query parameters to define what time range you're interested in).

Then combine the data that comes back with the data in the previously used datatable (using the addRows() method).

Then recreate the chart and set the range to what it was before the create.

This should give you the effect you are looking for.

  • Bob Light
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文