The Gruff Graphing Library is a project to make beautiful graphs with Ruby. Can be used alone or with Ruby on Rails.

Geoffrey Grosenbach boss@topfunky.com
Install easily with Ruby Gems (RMagick required):
sudo gem install gruff
The easiest way to use it with a Rails project is to unpack the gem into vendor/plugins and require it from environment.rb.
Also see the tests for examples of how to make a graph.
You can now graph negative numbers (line and bar), specify colors, and customize the graphs in other ways.
#!/usr/bin/ruby
require 'rubygems'
require 'gruff'
g = Gruff::Line.new
g.title = "My Graph"
g.data("Apples", [1, 2, 3, 4, 4, 3])
g.data("Oranges", [4, 8, 7, 9, 8, 9])
g.data("Watermelon", [2, 3, 1, 5, 6, 8])
g.data("Peaches", [9, 9, 10, 8, 7, 9])
g.labels = {0 => '2003', 2 => '2004', 4 => '2005'}
g.write('my_fruity_graph.png')
Yes, it can be a pain. I use DarwinPorts on Mac OS X and these general instructions (I didn’t have to manually edit the config as mentioned):
Personally, I prefer to have a “Reports” controller that does a call to the database and uses send_data to send the graph back to the browser. That way, you can use Rails caching and save some of the load on your server.
However, you can also use a Rails helper as mentioned here.
If Gruff doesn’t do what you need it to, you might try one of these other tasty delights: