OFC2 4 Rails

mix line with y axis chart

# include js file on site
  = javascript_include_tag 'swfobject.js'

# in controller
  #ofc2(width, height, url, id =Time.now.usec, flash_attributes = {}, flash_params = {})
  @graph = ofc2(650,300, 'charts_ofc2/mix_line_with_y_axis')

#in controller which is generating data for charts (for me it's charts_ofc2)
  
  def mix_line_with_y_axis
    title = OFC2::Title.new( :text => action_name.humanize , :style => "{font-size: 14px; color: #b50F0F; text-align: center;}")
    line_dot = OFC2::Line.new( :values => [900,800,700,1600,2500,4000,3300,1200,100,1200] )

    y_axis = OFC2::YAxis.new(:min => 0, :max => 4000, :steps => 1000)

    chart = OFC2::Graph.new
    chart.title= title
    chart.y_axis= y_axis

    chart << line_dot
    render :text => chart.render
  end
  

# display graph in view (haml)
  =@graph