Tonight I wanted to do something with Ruby Sparklines but I couldn’t get it to install so I somehow ended up playing with Gruff instead. You will now be impressed as I show a graph of words and comments in each of the posts for this weblog:

Well, perhaps not. I was though.
#!/usr/bin/ruby
require 'rubygems'
require 'gruff/base'
g = Gruff::Line.new(360)
g.title = "I'm just playing with gruff"
# this is only a subset of the above image
g.data("Comments", [0, 0, 0, 0 ]
# again, this is only a subset of the above image
g.data("Words", [257, 125, 87, 46 ]
g.write('comments.png')
I had to require grruff/base as require gruff wasn’t happening. Works though. Perhaps someone can tell me why require gruff didn’t work? I’m guessing RMagick or ImageMagick…
«0 CommentsMay 25, MMVI»
You've arrived at the homepage of Stephen Stewart. The archive is available here for those who want it. This site is happily hosted by Dreamhost. Click for more?
More!? OK then, but I can't help feeling that this will be a disappointment to you.
I work as a web designer in Belfast, and I live by the sea in a shoe. You can see me here, doing my livejournal pose as idoru called it. If you need to you can email me at carisenda -at- gmail -dot- com.