Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create graphs in Rails?

Does anyone know how do I create graphs in Rails. This is because I need to read and present statistics in rails and the best way to present the statistics is in a graph. So can anyone tell me how do I do so? Thanks! :)

like image 726
user1480797 Avatar asked Jul 19 '12 15:07

user1480797


1 Answers

There's a lot of options here. To try and keep things within Ruby I'd recommend checking out the ruport gem. Note that the last release of Ruport was in 2007.

As Calvin mentioned the other options involve Javascript solutions. There are two libraries that I like. The first is D3.js and can be found here:

http://d3js.org/

D3 is pretty flexible and has some powerful data manipulation tools for working with your data, however it tends to take a bit more development time to get something nice.

The other option I'd recommend is highcharts:

http://www.highcharts.com/

This library isn't as flexible as D3, but its much easier to get a really pretty chart up and running fast. The other thing is that it doesn't really have the data manipulation tools that D3 has. If you're looking for something simple though, I'd recommend trying Highcharts first.

like image 149
jklina Avatar answered Oct 04 '22 05:10

jklina