OFC2 4 Rails

line with nills 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/line_with_nills')

#in controller which is generating data for charts (for me it's charts_ofc2)
  
  def line_with_nills
    title = OFC2::Title.new( :text => action_name.humanize , :style => "{font-size: 14px; color: #b50F0F; text-align: center;}")
    line_dot_with_nills = OFC2::Line.new( :values => [1,nil,5,nil,3,nil,nil,nil,1,10] )
    chart = OFC2::Graph.new
    chart.title= title
    chart << line_dot_with_nills
    render :text => chart.render
  end
  

# display graph in view (haml)
  =@graph