OFC2 4 Rails

bar 3d 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/bar_3d')

#in controller which is generating data for charts (for me it's charts_ofc2)
  
  def bar_3d
    title = OFC2::Title.new( :text => action_name.humanize , :style => "{font-size: 14px; color: #b50F0F; text-align: center;}")
    bar = OFC2::Bar3d.new(:text => 'simple bar', :colour => '#D54C78')
    bar.values = [9,8,7,6,5,4,3,2,1]
    bar.values << OFC2::BarValue.new(:top => 10, :tip => 'Hello<br>#val#')

    x = OFC2::XAxis.new
    x.colour= '#909090'

    x = OFC2::XAxis.new
    x.offset= true
    x.min = 0
    x.max = 9
    x.___3d= 10

    x_labels = OFC2::XAxisLabels.new
    x_labels.steps= 1
    x.set_labels x_labels

    y = OFC2::YAxis.new(:min => 0, :max => 10)


    chart = OFC2::Graph.new
    chart.title= title
    chart << bar
    chart.x_axis= x
    chart.y_axis= y
    render :text => chart.render
  end
  

# display graph in view (haml)
  =@graph