Can anyone help me select the best JavaScript chart library? I want a pie开发者_Python百科 chart and a stacked bar chart. I tried Raphael chart but it doesn't look as good as a stacked bar chart, because it doesn't have the number scale. The chart library should be free.
In gRaphael, you can add a number scale to the stacked bar chart. It's a pain, but you'll be adding the axis class to your raphael.g object (or "paper"). You'll be adjusting the location of the axis to line up with your graph (the graph will add padding to the bottom, top and sides). With this, you can also add the dashes to the axis yourself.
axis = raphael.g.axis(xposition, yposition, length, startval, endval, numberOfDashes, whichAxis);
You'll need to set "whichAxis" to 1 for the y-axis, and 0 for the x-axis. The rest of that should make sense.
On terms of other free javascript charting libraries, if you don't care about backwards-compatibility with old browsers, Protovis is kind of cool. And their new library D3 is pretty sweet as well. Most of their stuff involves creating your own type of chart, instead of them creating a library for you to build off. It gives you a lot more freedom.
One terrible thing about gRaphael is that it is very particular on how it wants to display things, and doesn't give you much freedom to make your charts what you want. D3 definitely gives you that freedom. Unfortunately it relies on HTML5 and CSS3 features.
The JavaScript InfoVis Toolkit (JIT) is my favorite for its ease of use, and its beautiful charts.
精彩评论