GWT - 图表 - 大型数据集收到无响应警告
我正在学习 GWT 并制作了一个运行轮盘系统模拟的小型副项目应用程序。我使用 GWT 的可视化 API 在折线图中呈现结果。
我发现,如果结果超过绘制 1K 数据点,我就会开始收到来自 Firefox 和 Chrome 的无响应脚本警告,而 IE 基本上无论如何都会爆炸。
是从谷歌服务器端还是在客户端计算机上渲染图表时挂起的?不确定我是否理解所涉及的机制。
就解决方案而言:
1)如果是客户端问题,我是否可以以某种方式将数据发送到服务器端,在那里实例化图表,然后将其完成异步返回到浏览器,而不是占用客户端资源?
2)或者可视化API根本无法处理这么多数据点?
非常感谢。
I'm working on learning GWT and made a little side project app that runs roulette system simulations. I'm rendering the results using the visualization API for GWT in a line chart.
I've found if results go above charting 1K data points I start getting unresponsive script warnings from Firefox and Chrome and IE basically explodes no matter what.
Is the hang up in rendering the graph from the google server side or on the client machine? Not sure I'm understanding the mechanics involved.
In terms of solutions:
1) If it's a client side problem could I somehow send the data to my server side, instantiate the chart there, and simply return it completed to the browser asynchronously instead of hogging client resources?
2) Or is the visualization API simply not able to deal with so many data points?
Many thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
GWT-Visualization 连接到 google 服务器来下载库,但渲染是在客户端完成的。您无法使用它在服务器端进行渲染。
我还可以确认 Visuazation 无法处理 ~1K 点。
您可以尝试其他服务器端 GWT 库,例如 GFlot 或 clientsidegchart。
对于服务器端渲染,您可以使用任何 Java 图形库(例如 JGraph)。只需创建一个图形图像并将其下载到您身边。这样您就可以收到静态图像,但不会在客户端挂起。
The GWT-Visualization connect to google servers to download library, but the renders are done at client side. Your are not able to render on server side using it.
I can also confirm that Visuazation in not able to deal with ~1K point.
You can give a try to other server side GWT libraries like GFlot or clientsidegchart.
For server side render you can user any graph library for java (eg.JGraph). Just create a graph image and download it to your side. This way you receive static image but without hangings on client side.
也许是因为您正在使用 addValue() 逐一加载值。
有一个方法 addRows 接收 GWT 可视化库中未实现的值数组。这可能是加载数据的更快方式。
检查 GWT 图表
Maybe it's because you are loading values one by one with addValue().
There's a method addRows which receives an array of values that is not implemented in the GWT Visualization library. This could be a faster way of loading your data.
Check GWT Charts