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.