作者poga (波卡)
看板Ruby
标题[lib ] Scruffy 简单好用的图表制作
时间Sat Aug 19 19:26:54 2006
原本我是在这里看到
http://www.rubyinside.com/scruffy-a-beautiful-graphing-toolkit-for-ruby-
194.html
缩:
http://0rz.net/821Kv
Scruffy是一个可以很轻松的做出漂亮的图表的套件
语法上也很简洁
require 'scruffy'
graph = Scruffy::Graph.new
graph.title = "Comparative Agent Performance"
graph.value_formatter = Scruffy::Formatters::Percentage.new(:precision => 0)
graph.add :stacked do |stacked|
stacked.add :bar, 'Jack', [30, 60, 49, 29, 100, 120]
stacked.add :bar, 'Jill', [120, 240, 0, 100, 140, 20]
stacked.add :bar, 'Hill', [10, 10, 90, 20, 40, 10]
end
graph.point_markers = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun']
graph.render(:width => 800, :as => ‘JPG’)
程式码本身就很好懂 扩充性也很强大
==
不过问题出现了
我在用gem install scruffy 安装好这个套件之後
执行上面的程式码 都会出现如下的错误讯息:
C:\RubyProgram\HelloRuby/scruffy.rb:3: uninitialized constant Scruffy
(NameError)
from C:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
from C:/RubyProgram/HelloRuby/Scruffy.rb:1
嗯... 看起来就很像是找不到scruffy这个lib
可是我是用gem自动安装的ㄟ 我根本没有插手的机会阿 囧
有大大能帮忙查一下问题出在哪吗qq google也没看到什麽类似情况
==
怎麽每次我要装套件就会出问题阿.. Orz
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 218.170.67.8
1F:推 godfat:我觉得你又取了不该取的档名 XDb 08/19 21:55
2F:→ poga:好像真的是这样... Orz 08/20 00:38