Note: Version 2 of Open Flash Chart is available. Examples for version 2 are here.

Back to other graph examples

The Graph:



The Code:

This code in the controller:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
def view
  @graph = open_flash_chart_object(500,250, '/projects/open_flash_chart/three', true, '/projects/')     
end
def three
  data = []
  90.times do |t|
    data << Math.sin(t*0.3) + 1.5
  end
  g = Graph.new
  g.title("Sin 1.5", '{font-size: 12px;}')
  g.set_data(data)
  g.set_y_max(3)
  g.set_y_label_steps(3)
  render :text => g.render
end
And this code in the view:
1
<%= @graph %>

Back to other graph examples