Forum: Ruby on Rails Gruff & legend problems

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Pierre-Alexandre M. (Guest)
on 2007-04-03 22:48
(Received via mailing list)
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... ;)

++

--
,========================.
| Pierre-Alexandre M. |
| email : removed_email_address@domain.invalid |
`========================'
Pierre-Alexandre M. (Guest)
on 2007-04-04 14:21
(Received via mailing list)
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... ;)

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

--
,========================.
| Pierre-Alexandre M. |
| email : removed_email_address@domain.invalid |
`========================'
Jonathan W. (Guest)
on 2007-04-04 16:07
(Received via mailing list)
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... ;)
>
> 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
Pierre-Alexandre M. (Guest)
on 2007-04-04 19:43
(Received via mailing list)
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 ;)

--
,========================.
| Pierre-Alexandre M. |
| email : removed_email_address@domain.invalid |
`========================'
Pierre-Alexandre M. (Guest)
on 2007-04-04 19:52
(Received via mailing list)
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 : removed_email_address@domain.invalid |
`========================'
This topic is locked and can not be replied to.