Hi Everybody,
I m having problem in adding a graph generated by Gruff into a PDF
file.
Here is my graph method in controller:
def line_graph
g = Gruff::Line.new
g.title = "My Graph"
g.data("Apples", [1, 2, 3, 4, 4, 3])
g.data("Oranges", [4, 8, 7, 9, 8, 9])
g.labels = {0 => ''2003'', 2 => ''2004'',
4 => ''2005''}
send_data(g.to_blob, :disposition => ''inline'', :type =>
''image/
png'', :filename => "gruff.png")
end
I am able to display this in a normal view. But not into PDF file. I
am calling this into pdf in a partial:
pdf << render_to_string(:partial => "export_pdf")
Where _export_pdf.html.erb contains:
<%= image_tag url_for(:controller => "projects", :action =>
"line_graph"), :alt => "Line_graph" %>
Please help me out. I am struck in this from past few days..
Thanks,
Bob
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.