I’ve been putting together an automated report for my team, and decided to give prawn and scruffy a try. I ended up using Gruff, but here are some of the lessons along the way:
- Scruffy has issues with bar charts and values from 1-3 (actual values were
[1,3,1]
). I was able to get around this by setting a minimum value of 0 and a maximum of(datapoints.max + 1)
- Scruffy failed, miserably, when I just had one column.
- Prawn has issues, potentially, with png’s generated by gruff (It’s actually a rmagick issue). The easy way to get around this is to generate a jpg.
- I’d seen indications that you could use
to_blob
to generate the jpg, and yes, you can, but it won’t- Write the file
- If you attempt multiple generation types in sequence, it creates multiple copies of text in the resultant graph, and they don’t always line up.
Right now I’m working on packaging with rawr. Once that’s done, I’ll publish my results.
2 comments
Robor
February 4, 2009 at 4:16 pm (UTC -5) Link to this comment
Hi,
Great job. But not enought info. Where can i read more?
Thank you
Robor
Matt Williams
February 4, 2009 at 10:57 pm (UTC -5) Link to this comment
What sort of info are you looking for? An indepth tutorial? Step-by-step?
This was basically a gotcha type post. I can share more if you’d like.