移动设备上的动态图 [英] Dynamic Graphs on Movile Devices

查看:83
本文介绍了移动设备上的动态图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好

我必须开发要在移动设备上显示的动态图.就架构和技术而言,什么是最佳选择.

Hello

I have to develop the dynamic graphs to be displayed on mobile devices. What would be the best option available in terms of architecture and technology.

推荐答案

这取决于您的目标平台.

最简单的方法是使用基于Web的解决方案,因为您的用户无需安装任何东西,并且您无需为大量设备创建二进制文件.

如果要使用完全支持JavaScript的设备,则可以使用多种JavaScript框架中的任何一种来生成图形.

如果您不能依靠设备使用JavaScript进行渲染,则需要在服务器端渲染图形并将其实时输出为图像.

我过去曾经这样做过,并且使用过这种方法:
1)当请求页面时,我为要渲染的每个图形计算(并缓存了)唯一的键.
2)将图形键设置为图像的src属性.
3)浏览器请求图像,并且自定义处理程序接受密钥,并返回生成的图像.

有一些第三方图形库也可以生成图像,因此您无需在那里重新发明轮子.

干杯.
It depends on your target platform(s).

The easiest approach will be with a web-based solution as your users won''t have to install anything and you''ll not need to create binaries for a swath of devices.

If you are going to be on devices that fully support JavaScript, you can use any one of a number of JavaScript frameworks to generate the graphs.

If you can''t rely on the devices to render them with JavaScript, you''ll need to render the graphs server-side and output them as images on-the-fly.

I have done this in the past and used this approach:
1) When the page was requested I computed (and cached) a unique key for each of the graphs to be rendered.
2) The graph key was set up as the src attribute of the image.
3) The browser requests the image and a custom handler accepts the key, returning the generated image.

There are third party graphing libraries that can produce images as well, so you don''t need to re-invent the wheel there.

Cheers.


这篇关于移动设备上的动态图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆