http://pullmonkey.com/projects/open_flash_chart2
在rails3项目中安装OpenFlashChart的插件
rails plugin install git://github.com/pullmonkey/open_flash_chart.git
在某个controller的action中
def index
@graph = open_flash_chart_object(600,300,"/controller/graph_code")
end
def graph_code
title = Title.new("MY TITLE")
bar = BarGlass.new
bar.set_values([1,2,3,4,5,6,7,8,9])
chart = OpenFlashChart.new
chart.set_title(title)
chart.add_element(bar)
render :text => chart.to_s
end
end
在相应的view中
<script type="text/javascript" src="/javascripts/swfobject.js"></script>
<%= @graph.html_safe %>
在vender/plugin/open_flash_chart下的assert目录下的javascript中的swfobject.js,拷贝到public/javascripts/下,将assert/swf下的open-flash-chart.swf拷贝到public下
分享到:
相关推荐
NULL 博文链接:https://zyn-zyn.iteye.com/blog/1163148
Agile Web Development with Rails 5 英文无水印原版pdf pdf所有页面使用FoxitReader、PDF-XChangeViewer、SumatraPDF和Firefox测试都可以打开 本资源转载自网络,如有侵权,请联系上传者或csdn删除 查看此书...
Agile Web Development with Rails 3nd Edition beta
If you’re an experienced developer, this book will give you the comprehensive, insider information you need., Rails has evolved over the years, and this book has evolved along with it. We still ...
Agile Web Development with Rails
Agile Web Development with Rails (PDF)
agile web development with rails 5(英文电子书).............................................................................................................................................................
Ruby.on.Rails.Tutorial,Learn.Web.Development.with.Rails,Third.Edition-中文版 文字版.pdf 个人收集电子书,仅用学习使用,不可用于商业用途,如有版权问题,请联系删除!
Agile Web Development With Rails 3rdEdition Beta
Pragmatic - Agile Web Development with Rails 2ndPragmatic - Agile Web Development with Rails 2ndPragmatic - Agile Web Development with Rails 2ndPragmatic - Agile Web Development with Rails 2...
Agile Web Development with Rails 1-14节_ppt(老师发的修正版)
Agile Web Development with Rails 3nd Edition Beta
博文链接:https://jbf034.iteye.com/blog/219935
没什么好介绍的beta版,pdf 第四版,包括Rails 3的内容。
这是Agile Web Development with Rails for Rails 3.2, 为3.2的版本修改过的