使用 JavaScript 绘制饼图

发布于 2024-09-30 18:11:33 字数 112 浏览 1 评论 0原文

我想要一个 JavaScript 饼图,我已经有了一个带有 PlotKit 的饼图,但它是一个太大的库,而且我的带宽很低。我想要一个好的、低权重的 JavaScript 语言(或者更好的 jQuery 语言)。

I want to have a JavaScript pie chart, I already have one with PlotKit, but it's a too large library and my bandwidth is low. I want a good and low weighted one in JavaScript (or better, in jQuery).

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

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

发布评论

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

评论(4

时光倒影 2024-10-07 18:11:33

Google 提供了返回图表的网络服务。更多信息请参见:

http://code.google.com/intl/nl- NL/apis/chart/

alt text

Google supplies a webservice returning charts. More info here :

http://code.google.com/intl/nl-NL/apis/chart/

alt text

等风来 2024-10-07 18:11:33

我在我的一个库上使用了这个 http://www.jqplot.com/index.php 库项目。功能强大且易于使用!
这是饼图的示例:http://www.jqplot.com/tests/pieTests。 php

i used this http://www.jqplot.com/index.php library on one of my projects. powerful and easy to use!
And here is an example with pie charts: http://www.jqplot.com/tests/pieTests.php

小…红帽 2024-10-07 18:11:33

开放的数量不断增加
来源和商业解决方案
纯 JavaScript 图表,不
需要闪存。在这个回应中我将
仅提供开源选项。

JavaScript 有 2 个主要类
对于不支持图形的解决方案
需要闪存:

  • 基于Canvas,使用ExplorerCanvas在IE中渲染,而ExplorerCanvas又依赖于
    VML
  • 基于标准的浏览器上的 SVG,在 IE 中呈现为 VML

两者各有利弊
方法但适用于图表库
我会推荐后者,因为它
与 DOM 很好地集成,允许
操作图表元素
DOM,最重要的是设置 DOM
事件。相比之下 Canvas 图表
库必须重新发明 DOM 轮
管理事件。所以除非你打算
构建没有事件的静态图
处理,SVG/VML 解决方案应该是
更好。

对于 SVG/VML 解决方案有很多
选项,包括:

  • Dojox 图表,如果您已经使用 Dojo 工具包,那就太好了
  • 基于 Raphael 的解决方案

拉斐尔是一个非常活跃的人
维护、成熟、开源
图形库非常好
跨浏览器支持,包括 IE 6
至 8、Firefox、Opera、Safari、Chrome、
和征服者。拉斐尔不依赖
在任何 JavaScript 框架上以及
因此可以与原型一起使用,
jQuery、Dojo、Mootools 等...

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

  • gRaphael,Raphael 图形库的扩展
  • Ico,具有基于单个函数调用的直观 API 来创建
    复杂的图表

披露:我是一个开发者
github 上的 ICO 分叉
http://github.com/uiteoi/ico)。

作者:让·文森特

除此之外:

前 5 个 jQuery 图表插件

如果可以使用除 jQuery 之外的其他EJS 图表也非常流畅。

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:

  • Dojox Charting, good if you use the Dojo toolkit already
  • Raphael-based solutions

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
(http://github.com/uiteoi/ico).

by Jean Vincent

And other than this:

Top 5 jQuery Chart Plug-ins

If it is OK to use other than jQuery than EJS Charts are also very slick.

寒尘 2024-10-07 18:11:33

以下是一些带有 JQuery 图表插件的网站的链接:

http://www.jscharts.com/

http://www.reynoldsftw.com/2009/02 /6-jquery-chart-plugins-reviewed/

http://www.1stwebdesigner.com/resources/top-jquery-chart-libraries-interactive-charts/

和这个线程,本质上问的是同一个问题:

使用 jQuery 的饼图

编辑:添加了一些其他选项,

我最近使用 Flot 来做一些条形图
http://people.iola.dk/olau/flot/examples/

和我们使用 Raphael 制作一些饼图和其他东西
http://raphaeljs.com/

Here are some links to sites with JQuery charting plug-ins:

http://www.jscharts.com/

http://www.reynoldsftw.com/2009/02/6-jquery-chart-plugins-reviewed/

http://www.1stwebdesigner.com/resources/top-jquery-chart-libraries-interactive-charts/

and THIS SO thread, which is asking essentially the same question:

Pie chart with jQuery

EDIT: Added some other options

I recently used Flot to do some bar charts
http://people.iola.dk/olau/flot/examples/

and we're using Raphael for some pie charts and other stuff
http://raphaeljs.com/

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