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:

++


,========================.
| Pierre-Alexandre M. |
| email : [email protected] |
`========================’

On Tue, Apr 03, 2007 at 08:47:14PM +0200, Pierre-Alexandre M. wrote :

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 M. |
| email : [email protected] |
`========================’

On Wed, Apr 04, 2007 at 02:05:03PM +0200, Jonathan W. wrote :

Have you submitted it to the author? Looks good to me.

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:


,========================.
| Pierre-Alexandre M. |
| email : [email protected] |
`========================’

Pierre-Alexandre M. wrote:

On Tue, Apr 03, 2007 at 08:47:14PM +0200, Pierre-Alexandre M. wrote :

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

Have you submitted it to the author? Looks good to me.

Jonathan


Jonathan W.
http://blog.innerewut.de

On Wed, Apr 04, 2007 at 05:42:29PM +0200, Pierre-Alexandre M. wrote :

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.

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

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


,========================.
| Pierre-Alexandre M. |
| email : [email protected] |
`========================’