Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

The ruby on rails plugin for teethgrinder's Open Flash Chart (version 2)

tree: b2fee9ce32

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 assets
Octocat-spinner-32 lib
Octocat-spinner-32 tasks
Octocat-spinner-32 test
Octocat-spinner-32 MIT-LICENSE
Octocat-spinner-32 README
Octocat-spinner-32 Rakefile
Octocat-spinner-32 init.rb
Octocat-spinner-32 install.rb
Octocat-spinner-32 uninstall.rb
README
OpenFlashChart  Version 2.0.0  11/14/2008 
==============

1) rails ofc2_test_app
2) cd ofc2_test_app
3) script/plugin install git://github.com/pullmonkey/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
  
  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.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 - http://www.pullmonkey.com/projects/open_flash_chart


Copyright (c) 2008 PullMonkey, released under the MIT license
Something went wrong with that request. Please try again.