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
def view
  @graph = open_flash_chart_object(500,250, '/projects/open_flash_chart/two', true, '/projects/')     
end
def two
  g = Graph.new
  g.title("SPOON SALES", '{font-size: 26px;}')
  g.set_data([0,0,33,16,9,11,30,48,47,49,16,49])
  g.line(2,'0x80a033','Spoon Sale', 10)
  g.set_x_labels(%w(Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec))
  g.set_y_max(60)
  g.set_y_label_steps(6)
  render :text => g.render
end
And this code in the view:
1
<%= @graph %>

Back to other graph examples