gruff使ってみた。
これhttp://tam.qmix.org/wiki/RubyGruff.htmlを手本に
#!/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'} #==ここまではサンプルと同じ== #いろんなテーマのバリエーション a=%w{theme_keynote theme_37signals theme_odeo theme_rails_keynote } 4.times do |i| g.method(a.shift.to_s).call g.write("my_fruity_graph#{i}.png") end