require "alone" require "al_graph" class AjaxSampleController < AlController def action_index() AlTemplate.run("index.rhtml") end def action_get_graph() form = AlForm.new( AlText.new("v1"), AlText.new("v2"), AlText.new("v3"), AlText.new("v4"), ) form.validate() ydata = [ form[:v1].to_f, form[:v2].to_f, form[:v3].to_f, form[:v4].to_f ] graph = AlGraph.new() graph.set_mode( :NO_XML_DECLARATION ) graph.add_data_bar(ydata) graph.draw() end end