Graphene is a new Ruby gem for transforming collections of Ruby objects into subtotals, percentages, tables and graphs. See the source code at github.com/jhollinger/graphene and read the full documentation at rubydoc.info.
While the things Graphene does aren’t particularly difficult, they are repetitive and annoying enough that I wanted a quicker, DRYer way of doing them. So here’s my attempt. Let me know if it’s useful to you or can be improved.
Calculations
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | |
Tablize
1 2 3 4 5 6 7 8 9 | |
Gruff Graphs
This is the primary purpose of this library. I find Gruff’s documentation to be lacking. You have to dig through the code to find all of the available graph types and their options. And for some charts, the task of converting your objects into the proper numerical arguments is quite tedious. I’ve tried to fix all that.
Graphene supports Gruff’s pie charts, bar charts, stacked bar charts, side bar charts, side stacked bar charts, accumulation bar graphs, spider graphs, line graphs, net graphs and dot graphs.
Sample pie chart
1 2 3 4 | |

Sample line graph
1 2 3 4 5 6 7 8 9 10 | |
