开发者

Best JavaScript chart library or can we add a scale to Raphael bar chart?

开发者 https://www.devze.com 2023-03-08 16:44 出处:网络
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, bec

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消