line chart
# include js file on site
= javascript_include_tag 'swfobject.js'
# in controller
#ofc2(width, height, url, base='/', id = '')
@graph = ofc2(650,300, 'charts_ofc2/line')
#in controller which is generating data for charts (for me it's charts_ofc2)
def line
title = OFC2::Title.new( :text => action_name.humanize , :style => "{font-size: 14px; color: #b50F0F; text-align: center;}")
line_dot = OFC2::Line.new( :values => [9,8,7,6,5,4,3,2,1,12] )
chart = OFC2::Graph.new
chart.title= title
chart << line_dot
render :text => chart.render
end
# display graph in view (haml)
=@graph