Skip to content


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)
branch: master

Merge pull request #16 from lightswitch05/master

Added gradient background ability
latest commit 8f0b61afaa
Charlie authored


OpenFlashChart  Version 2.0.0  11/14/2008 

1) rails ofc2_test_app
2) cd ofc2_test_app
3) script/plugin install git://
3.1) If the install didn't copy the contents of the assets directory to your RAILS_ROOT/public directory, make sure to do so.
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 = "MY TITLE" ) do |c|
          c << :values => (1..10).sort_by{rand} )
        render :text => chart, :layout => false


6) Add the following to index.html.erb in RAILS_ROOT/app/views/test_it/:
  <script type="text/javascript" src="/javascripts/swfobject.js"></script>
<%= @graph %>

7) script/server
8) Let me know how it goes, thanks.


Example above and more to follow here -

The plugin breaks if the json gem is included, because of the way that the gem generates json vs the rails native json generator.

Not tested, but klochner claims to have implemented a fix for it here -

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