Ruby charting library?

2019-02-04 15:32发布

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?

9条回答
Luminary・发光体
2楼-- · 2019-02-04 16:06

Down with flash and imagemagick.

Try Highcharts with the lazy high charts plugin for ruby: github.com/michelson/lazy_high_charts.

查看更多
该账号已被封号
3楼-- · 2019-02-04 16:09

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

查看更多
Root(大扎)
4楼-- · 2019-02-04 16:10

Chartkick looks trending at the moment and also works with Highcharts.

查看更多
forever°为你锁心
5楼-- · 2019-02-04 16:15

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%>">
查看更多
Root(大扎)
6楼-- · 2019-02-04 16:16

For small graphs, there is Sparklines

查看更多
SAY GOODBYE
7楼-- · 2019-02-04 16:17

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.

查看更多
登录 后发表回答