Gruff & legend problems

Hi,

I have some problems with Gruff & legends. How do you handle many datas? When you have to many labels, the list doesn't fit in the image.

Looking at the source code, the draw_legend() just calculate the width of the legend (sum of the labels size) and append the labels to the current_x_offset. This is really painful for long legends...

Is there a way to change this behavior naturally or do I have to patch it? If someone has already geeked it, I don't want to reinvent the wheel... :wink:

http://mouraf.org/documents/rails/gruff-0.2.8.patch

Pierre-Alexandre Meyer wrote:

Actually, there are lots of patch in the trac which are not included in the core or revised by the author. Maybe he hasn't much time to work on this project.

Besides, look at my little post http://mouraf.org/blog/show/14. The lines are not centered and the final legend is not really pretty. I really don't know what to do : center each lines, justify legend, ... I think the best issue would be to draw a vertical legend on several columns.

Moreover, I haven't provide tests so it's not submittable :wink:

Sucks with several lines: http://mouraf.org/documents/rails/sucks.png

But rocks with single line: http://mouraf.org/documents/rails/rocks.png