Now, for my current project I have a need to use Gruff again, but this time I'm using JRuby. Normally gems work fine with JRuby, you just go "jgem install x" to install it. However, Gruff depends on RMagick, which (to the best of my knowledge) is written in C and therefore is not compatible with JRuby without a heck of a lot of hacking.
Fortunately, some folks out there somewhere created a gem called rmagick4j, which is a drop-in replacement for RMagick - well at least I think it is, I haven't found anything it does wrong yet. So, here's how to use Gruff with JRuby:
jgem install rmagick4j hoe gruffAnd done! Now you can make fancy graphs to impress your boss.
Unfortunately in this day and age, people come to expect more. If you look at the graphs on Google Analytics, they're much fancier than anything that Gruff could ever come up with. Chances are they're using Flex or something, which means you can have a much higher degree of interactivity than you can with just a simple image.
The tradeoff is that with Gruff, you can have a nice-looking graph with about 3-4 lines of Ruby, whereas Flex would probably take you quite a bit longer.
3 comments:
Hi, Rob,
My nickname is Serabe and I'm the current developer of rmagick4j. I'm so glad you like it but, still, rmagick4j has a lot of issues (the Image class has over 250 methods!). I've been away for two months (currently, I am an exchange student at Sweden) but soon, hopefully this weekend, I'll be back at work.
Thank you very much for your kind words!
Thanks! Nice post! Did you try other graphs for check that rmagick4j works fine ?
http://geoffreygrosenbach.com/projects/show/5
@Serabe: No problem! Thanks for making a great gem! I didn't actually know there was any issues with it, although I guess I haven't used it for too much other than basic image manipulation like cropping/resizing or generating some Gruff graphs.
I didn't test out Gruff with very many graphs (in hindsight I probably should have before writing this post...), we're just using line graphs with our app. I'll have to generate a bunch of other types to see how it works.
Keep up the good work guys!
Post a Comment