Reputation: 2593
I need to display some charts/graphs based upon user inputs on my web aplication built using Ruby on Rails. Are there any charting libraries out there that I could use with ROR for displaying simple bar, line and pie graphs?
Upvotes: 17
Views: 13065
Reputation: 774
I've two own options:
https://github.com/railsjazz/rails_charts - if you need to build complex charts, with many examples and helpers for easier use.
https://github.com/railsjazz/peity_vanilla_rails - if you need to add sparklines charts, simple, but informative (line, bar, pie..)
Upvotes: 0
Reputation: 188014
Or cloudsource the charts via google - here's the gem for that: https://github.com/mattetti/googlecharts
Example:
# console
$ ruby script/plugin install git://github.com/mattetti/googlecharts.git
# view
<img src="<%=GoogleChart.pie(['1997',10],['1998',70],['1999',20]).to_url%>">
Upvotes: 4
Reputation: 188014
There is a nice gem called
for graphs in ruby. You'll need the fabulous imagemagick and rmagick library. Since installation of the latter two is not really trivial (but not difficult, either), there's a installation FAQ for that.
Looks something like this:
More examples of this library: http://geoffreygrosenbach.com/projects/show/5
Upvotes: 12
Reputation: 10613
Chartkick looks trending at the moment and also works with Highcharts.
Upvotes: 0
Reputation: 4409
Down with flash and imagemagick.
Try Highcharts with the lazy high charts plugin for ruby: github.com/michelson/lazy_high_charts.
Upvotes: 7
Reputation: 2590
In addition to the aptly named googlecharts gem mentioned above there are two more that use the Google Charts API, gchartb and ruby-googlechart.
For the very awesome protovis javascript charting library, looks like someone has started a rails plugin called protovis on rails, but it still looks rough and hasn't been touched in a while.
Upvotes: 4
Reputation: 50057
Open Flash Chart 2 is very nice and pretty easy. You get more dynamic features (tooltips, onclick, hover, ...): looks nice :)
In this related question a few more very interesting alternatives are mentioned. Of which i find the most interesting (i am not allowed to use hyperlinks -so use google :)
These are both javascript libraries, offering the same kind of visual appearance and interactive as the flash alternative, without the flash, which is imho a big advantage. Aside of which it even seems there are more interactive options/possibilities than the open flash chart can offer. I am going to check these out :)
I am not allowed to show more than 1 url, so Google is your friend :)
Hope this helps :)
Upvotes: 3
Reputation: 5191
Yui chart from Yahoo it works also offline. There is a ruby plugin for it, I didn't know the name of it, sorry.
Upvotes: 0
Reputation: 3696
There is another gem called scruffy that does not need rmagick & imagemagick/graphicsmagick if you want to generate only svg.
Here is the project page http://scruffy.rubyforge.org that has quite a few examples
Upvotes: 1