Sha256: 3f36f64b9d09429a866a2a74e431d1d23b05904fcbb7f032ca5ba8f7e746ae86

Contents?: true

Size: 1.09 KB

Versions: 45

Compression:

Stored size: 1.09 KB

Contents

class <%= controller_class_name %>Controller < ApplicationController

  # To make caching easier, add a line like this to config/routes.rb:
  # map.graph "graph/:action/:id/image.png", :controller => "graph"
  #
  # Then reference it with the named route:
  #   image_tag graph_url(:action => 'show', :id => 42)

  def show
    g = Gruff::Line.new
    # Uncomment to use your own theme or font
    # See http://colourlovers.com or http://www.firewheeldesign.com/widgets/ for color ideas
#     g.theme = {
#       :colors => ['#663366', '#cccc99', '#cc6633', '#cc9966', '#99cc99'],
#       :marker_color => 'white',
#       :background_colors => ['black', '#333333']
#     }
#     g.font = File.expand_path('artwork/fonts/VeraBd.ttf', RAILS_ROOT)

    g.title = "Gruff-o-Rama"
    
    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 => '2004', 2 => '2005', 4 => '2006'}

    send_data(g.to_blob, :disposition => 'inline', :type => 'image/png', :filename => "gruff.png")
  end

end

Version data entries

45 entries across 45 versions & 11 rubygems

Version Path
gruff-0.13.0 rails_generators/gruff/templates/controller.rb
gruff-0.13.0-java rails_generators/gruff/templates/controller.rb
gruff-0.12.2 rails_generators/gruff/templates/controller.rb
gruff-0.12.2-java rails_generators/gruff/templates/controller.rb
gruff-0.12.1 rails_generators/gruff/templates/controller.rb
gruff-0.12.1-java rails_generators/gruff/templates/controller.rb
gruff-0.12.0 rails_generators/gruff/templates/controller.rb
gruff-0.12.0-java rails_generators/gruff/templates/controller.rb
gruff-0.11.0 rails_generators/gruff/templates/controller.rb
gruff-0.11.0-java rails_generators/gruff/templates/controller.rb
gruff-0.10.0 rails_generators/gruff/templates/controller.rb
gruff-0.10.0-java rails_generators/gruff/templates/controller.rb
gruff-0.9.0 rails_generators/gruff/templates/controller.rb
gruff-0.9.0-java rails_generators/gruff/templates/controller.rb
gruff-0.8.0 rails_generators/gruff/templates/controller.rb
gruff-0.8.0-java rails_generators/gruff/templates/controller.rb
mdg-1.0.1 vendor/bundle/ruby/2.3.0/gems/gruff-0.7.0/rails_generators/gruff/templates/controller.rb
gruff-0.7.0-java rails_generators/gruff/templates/controller.rb
gruff-0.7.0 rails_generators/gruff/templates/controller.rb
gruff-0.6.0-java rails_generators/gruff/templates/controller.rb