in view:
<%= link_to_remote 'test', :update => 'graph', :url =>{:controller => 'graph', :action => 'test', :text => 'test'} %>
generated html from view:
test action in controller:
def test
text = params[:text] || 'test'
g = Gruff::Line.new(400)
g.title = text
data = [0,2,2,nil,nil]
g.data(text,data)
send_data(g.to_blob,
:disposition => 'inline',
:type => 'image/png',
:filename => 'test')
end