pullmonkey / open_flash_chart
- Source
- Commits
- Network (33)
- Issues (0)
- Downloads (5)
- Wiki (1)
- Graphs
-
Tree:
45082f7
commit 45082f78c7ef7e60136ce2866c1e54f4185efcf7
tree 64b851c3d8f3b14bfb59f9f636ff36ada620e757
parent 6757a86000a0e96a6ea3afdd55e0a90288fb8dac
tree 64b851c3d8f3b14bfb59f9f636ff36ada620e757
parent 6757a86000a0e96a6ea3afdd55e0a90288fb8dac
open_flash_chart / README.rdoc
OpenFlashChart
========
1) rails ofc2_test_app 2) cd ofc2_test_app 3) script/plugin install git://github.com/dfl/open_flash_chart.git 4) script/generate controller test_it
5) Add the following to the test_it_controller.rb in RAILS_ROOT/app/controllers: class TestItController < ApplicationController
include OpenFlashChart
def index
respond_to do |wants|
wants.html {
@graph = open_flash_chart_object( 600, 300, url_for( :action => 'index', :format => :json ) )
}
wants.json {
chart = OpenFlashChart::Base.new( :title => Title.new("MY TITLE") ) do |c|
c << BarGlass.new( :values => (1..10).sort_by{rand} )
end
render :text => chart, :layout => false
}
end
end
end
6) Add the following to index.html.erb in RAILS_ROOT/app/views/test_it/: <html> <head>
<script type="text/javascript" src="/javascripts/swfobject.js"></script>
</head> <body> <%= @graph %> </body> </html>
7) script/server 8) Let me know how it goes, thanks.
Example
=
Example above and more to follow here - www.pullmonkey.com/projects/open_flash_chart
Copyright © 2008 PullMonkey, released under the MIT license
