views:

286

answers:

5

I used to work with flot but it doesn't support pie charts so I'm forced to change.

I just saw JS Charts, but their documentation is very obscure regarding cross browser compatibility (I need it to be IE6+ compliant :). Also this will be for commercial use, so I'd rather have something that I can use free of charge

jQuery Google chart looks really nice and is well integrated with rails (the framework I'm using) but I'm not sure how good it is.

So what do you guys use? What would you recommend keeping in mind that:

  • It will be for commercial use (I can deal with a license, but I'd rather avoid that)

  • It needs to be javascript (no svg, no flash please)

  • It needs to be compatible with IE6+, FF, Chrome, Opera and Safari

  • It needs to be pretty ^^

  • If it uses jQuery it's even better

A: 

Just a few days ago I was exploring on this and I found http://bluff.jcoglan.com/ Bluff.

It has a simple API and is cross browser compatible. The only drawback is that it uses the $ namespace and thus will conflict with many major JS frameworks such as jQuery. My workaround was to use jQuery.noConflict.

thephpdeveloper
Oh, I'm already using prototype and jQuery (I know, I know), so this would conflict with prototype... thanks for the answer thought
marcgg
+2  A: 

Maybe http://code.google.com/apis/chart/ can do what you need.

Josef
Looks pretty cool, did you ever use it?
marcgg
not really, but I played with it a little bit (beyond samples) and it worked fine.
Josef
I'm using it now and it's really nice. There is even a plugin for all you ruby on rails users
marcgg
+2  A: 

Most of the JavaScript based charting frameworks rely on Canvas which is not supported by IE. There are ways to make it work (excanvas), though.

I would suggest you stay away from JavaScript based frameworks unless you need to dynamically update or animate the chart. For everything else, server-side generated graphs are easier to implement, less of a hassle and you can find more pretty options.

I've had good luck with the Google Charting API that you've been referring to. It is quite extensive, can produce a great variety of plots. It's also very flexible when it comes to styles and colours, so it's easy to match a corporate style with it. One downside is, that it is sometimes too complex for what you might need. I especially had trouble getting my head around the axis scaling and labeling, but once you figure it out it's very powerful. I certainly would recommend this if you don't have problems with relying on a third party and don't need dynamic graphs. There is a jQuery plugin for it but I doubt you will need it if you can use a rails library.

Another charting framework that I've been using is jFreeChart (http://www.jfree.org/jfreechart/). It's Java based and open source. The graphs are reasonably pretty and has many different graph types. The Java API is extensive, but the documentation is not the best. You can buy the book from them though. At my company we built a fairly simple wrapper around it, that allows us to send XML formatted data to it and get a chart back, making it compatible with pretty much every language.

Franz
Thanks for the good answer and inputs. I'll test out this google api. Welcome on SO by the way ^^
marcgg
+1  A: 

Try this Jquery Visualize plugin

Another one interesting article 10-best-free-javascript-charts-solutions

Ramesh Vel
It looks like your pluging uses html 5, so it wouldn't work with IE6 isn't it?
marcgg
No, its not. Browsers that support HTML5 (firefox,opera) will work with the HTML 5 canvas element, othere (IE) will work with the exCanvas (by using VML)..
Ramesh Vel
+2  A: 

I'm recommend a Raphaël—JavaScript Library.

Here is example with pie chart: http://raphaeljs.com/pie.html

currently supports by Firefox 3.0+, Safari 3.0+, Opera 9.5+ and Internet Explorer 6.0+.

Coyod
Wow! That's really impressive! I'm afraid it's going to be too "cutting edge" for my clients, but this is definitively a great resource, I love it!
marcgg
I hope this will help you!
Coyod