223

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

Steve M
  • 10,517
  • 12
  • 52
  • 63

29 Answers29

160

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.

akaihola
  • 26,309
  • 7
  • 59
  • 69
Jean Vincent
  • 11,995
  • 7
  • 32
  • 24
  • 5
    Grafico and Ico are two incompatible forks of the initial Ico by Alex Young. So it is not accurate to state that Ico has become Grafico. Grafico being just one of the forks. – Jean Vincent Dec 26 '10 at 21:12
  • It should be noted that Raphael appears to be no longer maintained. The last commit was July 2010 or so. – Alastair Pitts Feb 25 '11 at 01:28
  • 1
    Just downloaded raphael charts, liking it lots but no docs, just to forewarn. – Brandon Frohbieter Mar 14 '11 at 00:20
  • @Alastair: Raphael is now sponsored and developed by Sencha... or so they say :) – Roy Tinker Jul 15 '11 at 03:03
  • 1
    SVG is not supported in pre-Honeycomb Android. If being able to view the charts on a broad range of current Android devices is a requirement, you'd have to pick a Canvas-based solution. [This article on Sencha Touch Charts](http://www.sencha.com/blog/introducing-sencha-touch-charts/) goes into more details on mobile charting in general, and why Sencha Touch went the Canvas route. – Pallavi Anderson Aug 01 '11 at 20:55
  • @"B Seven", IE9 has excellent support of SVG and Raphaël defaults to SVG in IE9. – Jean Vincent Aug 03 '11 at 11:02
  • @Pallavi, you are absolutely right, pre-Honeycomb Android is pretty much the only platform that supports neither VML nor SVG but supports Canvas. Although, as pointed out by Google themselves, one can still use Firefox on Androïd, but this is far from ideal. Eventually this issue will go away (Honeycomb). Unfortunately This means that there is no 100% cross-browser solution at this time. – Jean Vincent Aug 03 '11 at 11:08
  • @JeanVincent +1 for nice, detailed answer. One point to I would like to mention is, while choosing framework we should also see if particular framework provides facility to export charts,graphs. I think ,many of the times people want to export that chart as image and then use that same chart in her/his presentation. One example of such framework is HighCharts. I would like to know if there any other alternatives to highcharts. – Shekhar Jan 04 '12 at 08:50
70

If you're using jQuery I've found flot to be very good - try out the examples to see if they suit your needs, but I've found them to do most of what I need for my current project.

Additionally ExtJS 4.0 has introduced a great set of charts - very powerful, and is designed to work with live data.

Bittercoder
  • 11,753
  • 10
  • 58
  • 76
  • 2
    This is the same library Geoff Dalgas used to create the reputation graph here on StackOverflow. It truly is a nice bit of kit. – Charles Roper Oct 02 '08 at 17:24
  • My only real complaint about flot is that when rendering in IE it looks terrible at any zoom level other then 100% (i.e. all the lines/blocks don't scale together - this definitely a problem for those of us with high resolution displays). – Bittercoder Feb 03 '09 at 03:27
  • 2
    It looks like flot charts look nicer than many of the others I have looked at. Here's a link to 20 JavaScript chart libraries: http://javascript.open-libraries.com/utilities/chart/20-best-javascript-charting-and-plotting-libraries/ – B Seven May 20 '11 at 15:07
  • I like flot too, have used this many times on different web apps before. – fedmich Aug 23 '11 at 03:09
  • 1
    I like flot in general but it wants all data to be numbers, so if you want to plot something like sales per customer (by name) or per product it won't work – Zachary K Nov 24 '11 at 10:34
60

Check out http://www.highcharts.com !

Highcharts is a charting library written in pure JavaScript, offering an easy way of adding interactive charts to your web site or web application. Highcharts currently supports line, spline, area, areaspline, column, bar, pie and scatter chart types.

Yahel
  • 37,023
  • 22
  • 103
  • 153
Torstein Hønsi
  • 541
  • 4
  • 2
  • 12
    Worth pointing out that this library is free for non-commercial use, but costs money for single-sites and multi-sites. It seems like a fairly reasonable price however. – Nick Spacek May 18 '10 at 18:08
  • At first it as a shameless plug but they look REALLY awesome!! It in not free fot commercial use though, I have no reference wether the pricing is reasonable or not but they look ok at a glance! – Trufa Dec 10 '10 at 12:07
  • This is the same charting library used in CloudFlare.com, and it looks really great. I was about to use DevExpress charting library, which is ASP.NET and renders and image in the sever when I stumbled upon the highcharts library. I was convinced at once that this is the way to go. When I found out that CloudFlare, which has one of the most eye-catching dashboards/analytic's I've seen, uses it too I was sold! I'm currently experimenting with it, and it worked in my first attempt to embed a chart in my webpage... so it seems easy to use too! – Loudenvier Aug 04 '11 at 03:07
  • 1
    One more vote for Highcharts. I'm currently using it, and it is great. Supports jQuery, Mootools and Prototype, and it is very easy to setup and use. – gnclmorais Aug 10 '11 at 09:53
  • 1
    Stackoverflow itself uses highcharts http://stackoverflow.com/users/22656/jon-skeet?tab=reputation – Scott Sep 30 '11 at 00:11
  • One more vote for Highcharts. I'm using it, and it is great. The JQuery support (with JSON data) is simple to setup and use. – Irvin Dominin Nov 21 '11 at 13:04
  • I think highcharts allows us to export the charts and graphs as image. +1 for mentioning highcharts – Shekhar Jan 04 '12 at 08:52
36

It maybe not exactly what you are looking for, but
Google's Chart API is pretty cool and easy to use.

Jan Gressmann
  • 5,481
  • 4
  • 32
  • 26
  • 5
    just remember, Google Chart requires internet connection and also has some limits on the number of client requests allowed – fedmich Aug 23 '11 at 03:08
  • @user102008: it is now :) (You can still access the old [image based API](http://code.google.com/apis/chart/image/) if you want to) – Spycho Oct 12 '11 at 10:17
  • Google Chart API cannot be used offline, bad for mobile development. – oldwizard Feb 27 '12 at 14:22
  • I need to do a horizontal type Candlestick, anyone know if it is possible with google chart api ? – Tom Stickel Apr 04 '12 at 16:41
15

There is another javascript library based on SVG. It is called Protovis and it comes from Stanford Visualization Group

It also allows making nice interactive graphics and visualizations.

http://vis.stanford.edu/protovis/ex/

Although it is only for modern web browsers

UPDATE: The protovis team has moved to another library called d3.js (Data Driven Documents) as they said:

"The Protovis team is now developing a new visualization library, D3.js, with improved support for animation and interaction. D3 builds on many of the concepts in Protovis"

The new library can now be found in:

http://mbostock.github.com/d3/

UPDATE 2:

"Rickshaw" is a JavaScript toolkit for creating interactive time series graphs. Based on d3.js that simplifies a lot the work with d3.js although is a little bit less powerful.

http://code.shutterstock.com/rickshaw/

Fgblanch
  • 5,195
  • 8
  • 37
  • 51
  • Based on a quick look, I don't think D3 "replaces" Protovis. I would say that the team "moved on" because they see it as more interesting and cutting edge. – David J. Aug 02 '11 at 02:38
14

jqPlot is great. If your requirements are fairly "normal" and you just want to draw some charts, you're probably overwhelmed by the quantity of js charting options. Assuming you don't want to do hours of research, just go with jqPlot as it's probably your best bet. It covers most use cases for most people well. Some of the alternatives are specialised on a certain type of chart or built with a certain use case in mind.

Fletch
  • 4,829
  • 2
  • 41
  • 55
  • I think so as well after doing some research. Right now it looks like one of the best free JS chart libraries available. – jturcotte Jul 08 '10 at 11:48
14

I was recently looking for a javascript charting library and I evaluated a whole bunch before finally settling on jqplot which fit my requirements very well. As Jean Vincent's answer mentioned you are really choosing between canvas based and svg based solution.

To my mind the major pros and cons were as follows. The SVG based solutions like Raphael (and offshoots) are great if you want to construct highly dynamic/interactive charts. Or if you charting requirements are very much outside the norm (e.g. you want to create some sort of hybrid chart or you've come up with a new visualization that no-one else has thought of yet). The downside is the learning curve and the amount of code you will have to write. You won't be banging out charts in a few minutes, be prepared to invest some real learning time and then to write a goodly amount of code to produce a relatively simple chart.

If your charting requirements are reasonably standard, e.g. you want some line or bar graphs or perhaps a pie chart or two, with limited interactivity, then it is worth looking at canvas based solutions. There will be hardly any learning curve, you'll be able to get basic charts going within a few minutes, you won't need to write a lot of code, a few lines of basic javascript/jquery will be all you need. Of course you will only be able to produce the specific types of charts that the library supports, usually limited to various flavors of line, bar, pie. The interactivity choices will be extremely limited, that is to say non-existent for many of the libraries out there, although some limited hover effects are possible with the better ones.

I went with JQplot which is a canvas based solution since I only really needed some standard types of charts. From my research and playing around with the various choices I found it to be reasonably full-featured (if you're only after the standard charts) and extremely easy to use, so I would recommend it if your requirements are similar.

To summarize, simple and want charts now, then go with JQplot. Complex/different and not pressed for time then go with Raphael and friends.

skorks
  • 4,376
  • 18
  • 31
4

As some kind of late answer, try d3.js
http://mbostock.github.com/d3/

It's the continuation of protovis.
The big difference to flot is in the number of features supported.
Though flot may be simpler, d3.js is definitely more powerful.

Stefan Steiger
  • 78,642
  • 66
  • 377
  • 442
3

Flotr is another, pure Javascript chart-library based on Prototype and inspired by Flot

Argelbargel
  • 5,840
  • 2
  • 23
  • 16
3

Try PlotKit

Jason Bunting
  • 58,249
  • 14
  • 102
  • 93
3

I'd recommend gRaphaël for pure JavaScript charting along with the pure JavaScript vector graphics library it's built on (Raphaël).

gRaphaël currently supports Firefox 3.0+, Safari 3.0+, Opera 9.5+ and Internet Explorer 6.0+.

Peter McG
  • 18,857
  • 8
  • 45
  • 53
3

a basic: http://www.filamentgroup.com/examples/charting_v2/index_2.php

good looking: http://www.highcharts.com/

pablov
  • 149
  • 10
3

Another is RGraph: Javascript charts and graph library:

http://www.rgraph.net

Canvas based so it's fast and there's roughly 20 different chart types. It's free for non-commercial use too!

Richard
  • 11
  • 1
2

Try the MIT simile timeline which could be made into a chart - http://simile.mit.edu/timeline/

or the final one, http://code.google.com/p/gchart/

Jeremy
  • 1
  • 85
  • 340
  • 366
Chii
  • 14,540
  • 3
  • 37
  • 44
2

My favourite (flot) has already been mentioned.

But be sure to investigate Ortho. It is excellent for tree charts and timelines.

Rui Vieira
  • 5,253
  • 5
  • 42
  • 55
2

There is a lot of activity in the dojo charting library, and what is great I am using it inside an AIR application without problems too, pretty cool! See for example there http://www.sitepen.com/blog/2008/05/27/dojo-charting-event-support-has-landed/

Wolfram Kriesing
  • 1,527
  • 10
  • 7
2

Check out Google Visualization API, which is kind of a generalization of the simpler Chart API

Mauricio Scheffer
  • 98,863
  • 23
  • 192
  • 275
2

http://code.google.com/apis/visualization/documentation/gallery.html

Has very cool interactive options including maps, gauges, and charts.

Ryan Charmley
  • 1,127
  • 15
  • 18
2

We just bought a license of TechOctave Charts Suite for our new startup. I highly recommend them. Licensing is simple. Charts look great! It was easy to get started and has a powerful API for when we need it. I was shocked by how clean and extensible the code is. Really happy with our choice.

Aaron Reis
  • 21
  • 1
1

Not a Javascript library but it may be a suitable alternative - check out Google Charts where you can generate charts by passing querystring data to their web service.

Luke Bennett
  • 32,786
  • 3
  • 30
  • 57
1

Take a look at Bluff. It's a JavaScript port of the Gruff graphing library for Ruby.

John Topley
  • 113,588
  • 46
  • 195
  • 237
1

Protochart is all you need

Razor
  • 17,271
  • 25
  • 91
  • 138
1

Sencha acquired Raphael and now their charts are pure javascript as of version 4. Emprise and HighCharts mentioned above are my two favorites.

http://www.sencha.com/

Justin Thomas
  • 5,680
  • 3
  • 38
  • 63
1

For the more unusual charts: http://thejit.org/

PhoebeB
  • 8,434
  • 8
  • 57
  • 76
0

Check out ZingChart HTML5 Canvas, SVG, VML and Flash Charts. Very powerful and compatible library. I'm on the Zing team - mention us on twitter @zingchart or shoot any questions to support@zingchart.com.

Amar Palsapure
  • 9,590
  • 1
  • 27
  • 46
0

I can recommend ArcadiaCharts. A brand-new professional charting library for JavaScript and GWT. Runs in all browsers without plugins. Easy and fast to use: creates great looking charts with just a few lines of code. Free for non-commercial use.

  • I was playing around with this, and I noticed there's no way to get a commercial license on the web site. In fact, the web site is not clear whether this is free or not. – zumalifeguard Feb 23 '12 at 03:50
  • You are right. The website has been updated, so that you can now easily find out which commercial license fits to your requirements: [ArcadiaCharts](http://www.arcadiacharts.com/purchase). – Hoang-Tran Vo May 11 '12 at 10:24
0

Fusion charts has a new javascript/jquery library that looks promising.

amurra
  • 15,221
  • 4
  • 70
  • 87
0

In case what you need is bar chart only. I published some code I've been using in an old project. Someone told me the VML implementation is broken on recent versions of IE, but the SVG should work just fine. Might be getting back to the project and release some serverside renderers I already have and maybe WebGL rendering layer. There's a link: http://blog.conquex.com/?p=64

0

Probably not what the OP is looking for, but since this question has become a list of JS charting library options: jQuery Sparklines is really cool.

Fletch
  • 4,829
  • 2
  • 41
  • 55