JavaScript图表库 [英] JavaScript Chart Library

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

问题描述

有人会推荐一个特定的JavaScript图表库,特别是一个不使用flash的图表库?

解决方案

越来越多的开源和商业解决方案,不需要Flash的纯JavaScript图表。在此响应中,我将只显示开源选项。



对于不需要Flash的图形,有两种主要的JavaScript解决方案类型:




  • 基于画布,在IE中使用ExplorerCanvas呈现,后者依赖于VML

  • 在基于标准的浏览器上呈现为SVG in IE



这两种方法都有利弊,但对于图表库我建议稍后,因为它与DOM ,允许使用DOM操作图表元素,最重要的是设置DOM事件。相比之下,Canvas图表库必须重新创建DOM轮来管理事件。因此,除非您打算在没有事件处理的情况下构建静态图形,否则SVG / VML解决方案应该更好。



对于SVG / VML解决方案有很多选项, p>



a href =http://raphaeljs.com/ =nofollow noreferrer> Raphael 是一个非常活跃,维护良好,成熟的开源图形库,具有非常好的跨浏览器支持,包括IE 6到8,Firefox,Opera,Safari,Chrome和Konqueror。 Raphael不依赖于任何JavaScript框架,因此可以用于Prototype,jQuery,Dojo,Mootools等...



有许多图表库Raphael,包括(但不限于):




  • gRaphael ,Raphael图形库的扩展

  • Ico ,使用基于单个函数调用的直观API创建复杂图表



披露: github上的Ico分支之一的开发人员。


Would anyone recommend a particular JavaScript charting library - specifically one that doesn't use flash at all?

解决方案

There is a growing number of Open Source and commercial solutions for pure JavaScript charting that do not require Flash. In this response I will only present Open Source options.

There are 2 main classes of JavaScript solutions for graphics that do not require Flash:

  • Canvas-based, rendered in IE using ExplorerCanvas that in turns relies on VML
  • SVG on standard-based browsers, rendered as VML in IE

There are pros and cons of both approaches but for a charting library I would recommend the later because it is well integrated with DOM, allowing to manipulate charts elements with the DOM, and most importantly setting DOM events. By contrast Canvas charting libraries must reinvent the DOM wheel to manage events. So unless you intend to build static graphs with no event handling, SVG/VML solutions should be better.

For SVG/VML solutions there are many options, including:

Raphael is a very active, well maintained, and mature, open-source graphic library with very good cross-browser support including IE 6 to 8, Firefox, Opera, Safari, Chrome, and Konqueror. Raphael does not depend on any JavaScript framework and therefore can be used with Prototype, jQuery, Dojo, Mootools, etc...

There are a number of charting libraries based on Raphael, including (but not limited to):

  • gRaphael, an extension of the Raphael graphic library
  • Ico, with an intuitive API based on a single function call to create complex charts

Disclosure: I am the developer of one of the Ico forks on github.

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

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