Graphs using ruport

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”

Seena N. 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

On Feb 27, 7:31 am, Seena N. [email protected] wrote:

this is the code i had written:------ for the reference
Hi… can you please post this example code and the stack trace from
your Rails application to:

http://list.rubyreports.org

Over there, it may help benefit other users with the same problem.

Thanks,

-greg