graphs using ruport

S

Seena Nair

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"
 
S

Seena Nair

Seena said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top