Web应用程序中的绘图图 [英] Plot Graph In web application

查看:80
本文介绍了Web应用程序中的绘图图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Spring开发一个Web应用程序.我需要绘制图形并将其显示给用户.这些值存储在数据库中.我该如何实现?

I am developing a web application using Spring. I need to plot graphs and display them to the user. The values are stored in a database. How do I achieve this?

推荐答案

您必须确定要在何处创建图表.您有两种选择:

You have to decide where do you want to create the charts. You have two options:

  1. 在服务器上创建图表并将其作为图像或pdf发送给客户端.
  2. 将原始数据发送到客户端,让他们通过html,flash或javascript呈现图表

每种方法都有其自身的优点和局限性-您必须根据自己的具体情况来决定.

Each way has its own advantages and limitations - you have to decide for your specific use case.

如果在服务器端绘制图表,则交互性受到限制,但是客户端不需要太多性能来绘制图表.在这里,您必须考虑缓存以保护服务器性能.

If you render the charts on server side you are limited regarding interactivity but you clients don't need much performance to render the charts. Here you have to think about caching to protect your server performance.

在客户端,您必须处理不同的浏览器,并且必须考虑客户端的渲染性能.

On the client side you have to deal with diffent browsers and must think about the client render performance.

如果您觉得2没问题,我建议您使用javascript-这样您的用户就无需安装任何插件(例如Flash),并且您就有很多创建漂亮图表的可能性.

If 2. is ok for you, I would recommend using javascript - so your users don't need to install any plugins like flash and you have a lot of possibilites to create nice charts.

有一些不错的框架可以使用javascript创建图表,例如:

There are some nice frameworks to create charts using javascript, for example:

  • HighCharts
  • gRaphaël
  • JS Charts
  • ...

这篇关于Web应用程序中的绘图图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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