Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save daipresents/21ab0a8ba3662dacd17edeec840ad9f0 to your computer and use it in GitHub Desktop.
Save daipresents/21ab0a8ba3662dacd17edeec840ad9f0 to your computer and use it in GitHub Desktop.
RedmineプラグインでOpen Flash Chart(OFC2)を使うとIO ERROR
def index
@graph = open_flash_chart_object(600,300,"/version_burndown/graph_code")
end
Open Flash Chart
IO ERROR
Loading test data
Error #2032
This is the URL that I tried to open:/version_burndown/graph_code
<script type="text/javascript">
swfobject.embedSWF("/open-flash-chart.swf", "flash_content_DleU0GzY", "800", "450", "9.0.0", "expressInstall.swf",{"data-file":"%2Fversion_burndown%2Fgrapha_code"});
</script>
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>
def index
@graph = open_flash_chart_object( 800, 450, url_for( :action => 'graph_code', :project_id => @project.id, :version_id => @version.id ) )
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment