From: Seena Nair Date: 2008-02-27T21:31:49+09:00 Subject: Re: graphs using ruport Seena Nair wrote: > plz help!!!!!!!!!! > i am trying to create graphs using the ruport gem. even though it > creates the graph "sales.png". but it does not show it on the browser in > the application. > when i try to call it on the browser window it gives me an error saying > "sorry something went wrong and it has been notified" the code : this is the code i had written:------ for the reference require 'rubygems' require 'ruport' require 'ruport/util' class GraphReportController < Ruport::Report renders_as_graph def renderable_data(format) graph = Graph(%w[a b c d e]) graph.series [1,2,3,4,5], "foo" graph.series [11,22,70,2,19], "bar" draw_graph(graph, :title => "Graph", :labels =>"Label") # send_data(graph.to_blob, :disposition => 'inline', :type => 'image/png', :filename => "foo.png") return graph end end GraphReportController.generate do |r| r.as(:png, :title => "My Graph", :labels => {0 => '2003', 2 => '2004', 4 => '2005'}, :file => "my_graph.png" ) end -- Posted via http://www.ruby-forum.com/.