English 中文(简体)
JavaScript Charts API: Flot jQuery Plugin OR Google Visualization?
原标题:

I am looking for a charts library to be displayed on a website. I will use intensively this library (for area, line and bar charts mainly), so I prefer to secure my choice before starting implementing.

The list of website chart libraries that I have initially considered are:

However after some researches on this forum and investigations on the web, I have reduced my candidate list to these two libraries:

  1. Flot jQuery plugin
  2. Google Visualization

Which one do you advise me to use and why (if you have worked with one or two of them, please tell me your feedback)?

How do they compare one to each other regarding ease of use, performance and features?

Thank you

EDIT: Based-Flash Chart libraries were not eligible with my constraints

最佳回答

I will try to answer my own question after some several tries and researches about these 2 visualization libraries, here are my own list of pros for each solution :

Flot Pros


  1. jQuery plugin : if you are familiar with jQuery (or if your apps is integrated with jQuery), it seems natural to use Flot
  2. Offline visualization : you can test or have it installed into an internal website. Google Visu can only work if you have acces to the google website !!
  3. Customization : this is basically a JavaScript file so if you are good at JS coding, you can customize your charts as your convenience. Also the Flot plugin system allows you better modularity

Google Visualization Pros


  1. Documentation : awesome ! Examples for each type of graphs are available in the Google site
  2. Easy to use : Really. Easier than Flot (that requires to somehow customize the div container)
  3. Powerful : you have many sorts of graphs and features (zooming, interactivity,...)
  4. Java and Python API : it can helps a lot for constructing the Data Table (at least for me, I can use the Java API)

Bottom Line


If you are familiar with jQuery, go with Flot. If you need for some reasons to see your charts offline, go with Flot. If you want full control, go with Flot.

If you don t recognize yourself above, go with Google Visu. It s easy to learn and implement, very well documented and extremely powerful.

问题回答

Not in your list, but I would recommend you have a look at Highcharts http://www.highcharts.com/ Highcharts is SVG, and as such, it is much more dynamic than Flot, you can restyle graphs with CSS, attach events, perform animations, etc... It is also compatible with IE6 and it works server-side (thx to Batik) I m currently building a graph-intensive application, and chose Highcharts after lots of benchmarkings. I don t regret my choice.

The piwik project uses the Open Flash Chart (not on your list).

It s easy to use, has plenty of working examples very user friendly.

I am a user of Flot, and a big fan. I use it in a Grails application, and use stacked bar, line, and pie charts, including time-series and a bunch of interactive capabilities (i.e. turn off / on series with checkboxes, etc).

I found it to be a pleasure to work with overall, and feel the API is quite well developed (I saw that a bunch of other JS charting libraries adopted the API, so you ll even have some flexibility to move to another kit in the future). From looking at the google API just now for a minute, I think I like flot s better (although google may have ability to pass in a series as well, didn t see it from samples).

They just came out with a new version a few weeks ago (0.6), that supports plugins, which I expect will stimulate more innovation.

So I think part of this depends on other technologies you are planning to use. It seems like Visualization is integrated with GWT, so if you are thinking of using that, Visualization is the way to go. On the other hand, if you are thinking of using JQuery for AJAX, then Flot might be a more natural fit.

When I was making my decision to use this, it seems like Google didn t have interactive visualizations, only google charts (images), which is one of the reasons I went with Flot.

There is jqPlot (http://www.jqplot.com/), an open source project which looks good. Based on jQuery as well. I will give jqPlot a try, jQuery flot seems to be inactive.

Not in your list, but very impressive: ExtJS 4.0 charts





相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签