Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
unknown
authored and
unknown
committed
Oct 21, 2010
1 parent
367f2da
commit b89a845
Showing
65 changed files
with
1,348 additions
and
1,138 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,54 @@ | ||
= open_flash_chart | ||
|
||
This library was ported from the open flash chart project's php code to be used with Ruby on Rails. | ||
Vish the open flash chart project here - http://teethgrinder.co.uk/open-flash-chart/ | ||
|
||
== Resources | ||
|
||
Install | ||
|
||
* script/plugin install http://svn.pullmonkey.com/plugins/trunk/open_flash_chart/ | ||
* move the open_flash_chart.swf file to your public directory | ||
* move the swfobject.js file to your public/javascripts directory | ||
* visit http://pullmonkey.com/projects/open_flash_chart for examples | ||
* visit http://teethgrinder.co.uk/open-flash-chart/ for even more examples | ||
|
||
Rubyforge project | ||
|
||
* | ||
|
||
RDocs | ||
|
||
* | ||
|
||
Subversion | ||
|
||
* http://svn.pullmonkey.com/plugins/trunk/open_flash_chart | ||
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 | ||
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 = 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 | ||
|
||
Notes | ||
====== | ||
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 - http://github.com/klochner/open_flash_chart/commit/00cf531387880af8c49ed5118737f0492b437f75 | ||
|
||
Copyright (c) 2008 PullMonkey, released under the MIT license |
5 changes: 5 additions & 0 deletions
5
vendor/plugins/open_flash_chart/assets/javascripts/swfobject.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file added
BIN
+448 KB
vendor/plugins/open_flash_chart/assets/open-flash-chart-bar-clicking.swf
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
# Include hook code here | ||
require 'open_flash_chart' | ||
|
||
ActionView::Base.send :include, OpenFlashChart::View | ||
OpenFlashChart::Base.send :include, OpenFlashChart::View | ||
ActionController::Base.send :include, OpenFlashChart::Controller | ||
ActionController::Base.send :include, OpenFlashChart | ||
ActiveRecord::Base.send :include, OpenFlashChart::View | ||
ActiveRecord::Base.send :include, OpenFlashChart::Controller | ||
ActiveRecord::Base.send :include, OpenFlashChart |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,17 @@ | ||
# Install hook code here | ||
# Workaround a problem with script/plugin and http-based repos. | ||
# See http://dev.rubyonrails.org/ticket/8189 | ||
Dir.chdir(Dir.getwd.sub(/vendor.*/, '')) do | ||
|
||
## | ||
## Copy over asset files (javascript/css/images) from the plugin directory to public/ | ||
## | ||
|
||
def copy_files(source_path, destination_path, directory) | ||
source, destination = File.join(directory, source_path), File.join(RAILS_ROOT, destination_path) | ||
# FileUtils.mkdir(destination) unless File.exist?(destination) | ||
FileUtils.cp_r(Dir.glob(source+'/*.*'), destination) | ||
end | ||
|
||
directory = File.dirname(__FILE__) | ||
copy_files("/assets", "/public", directory) | ||
end |
Oops, something went wrong.