1 class <%= controller_class_name %>Controller < ApplicationController
3 # To make caching easier, add a line like this to config/routes.rb:
4 # map.graph "graph/:action/:id/image.png", :controller => "graph"
6 # Then reference it with the named route:
7 # image_tag graph_url(:action => 'show', :id => 42)
11 # Uncomment to use your own theme or font
12 # See http://colourlovers.com or http://www.firewheeldesign.com/widgets/ for color ideas
14 # :colors => ['#663366', '#cccc99', '#cc6633', '#cc9966', '#99cc99'],
15 # :marker_color => 'white',
16 # :background_colors => ['black', '#333333']
18 # g.font = File.expand_path('artwork/fonts/VeraBd.ttf', RAILS_ROOT)
20 g.title = "Gruff-o-Rama"
22 g.data("Apples", [1, 2, 3, 4, 4, 3])
23 g.data("Oranges", [4, 8, 7, 9, 8, 9])
24 g.data("Watermelon", [2, 3, 1, 5, 6, 8])
25 g.data("Peaches", [9, 9, 10, 8, 7, 9])
27 g.labels = {0 => '2004', 2 => '2005', 4 => '2006'}
29 send_data(g.to_blob, :disposition => 'inline', :type => 'image/png', :filename => "gruff.png")