Skip to content

Instantly share code, notes, and snippets.

@pglombardo
Created July 18, 2012 22:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pglombardo/3139281 to your computer and use it in GitHub Desktop.
Save pglombardo/3139281 to your computer and use it in GitHub Desktop.
Rails Charts Controller for gchartrb
class ChartsController < ApplicationController
def index
GoogleChart::PieChart.new('320x200', "Pie Chart",false) do |pc|
pc.data "Apples", 40
pc.data "Banana", 20
pc.data "Peach", 30
pc.data "Orange", 60
@chart_url = pc.to_url
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment