Done.
(Thanks to Jim Morris for his Ruby-HTMLization-fu)
# GruffGraphController.rb
# GrufferGrapher
#
# Created by Dave on 5/16/08.
# Copyright (c) 2008. All rights reserved.
#
require 'osx/cocoa'
require 'rubygems'
require 'gruff'
class GruffGraphController < OSX::NSObject
ib_outlet :imageOutlet
def awakeFromNib
g = Gruff::Pie.new
g.data("ASN 1", 5)
g.data("ASN 2", 3)
 b = g.to_blob
d = OSX::NSData.alloc.initWithBytes_length(b, b.length)
i = OSX::NSImage.alloc.initWithData(d)
@imageOutlet.setImage(i)
end
end
No comments:
Post a Comment