# Need some Gruff graphing help - custom dimensions?

**URL:** <https://www.ruby-forum.com/t/need-some-gruff-graphing-help-custom-dimensions/97185>\
**Category:** Rails\
**Created:** [July 5, 2006, 2:14pm UTC](https://www.ruby-forum.com/t/need-some-gruff-graphing-help-custom-dimensions/97185 "2006-07-05T14:14:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![marstoni](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e9bcb4/32.png) [@marstoni](https://www.ruby-forum.com/u/marstoni)\
**Post date:** [July 5, 2006, 2:14pm UTC](https://www.ruby-forum.com/t/need-some-gruff-graphing-help-custom-dimensions/97185/1 "2006-07-05T14:14:12Z")

</div>

I’ve been working with Gruff to do all my apps graphing and such etc. I  
love it but I’m just having a hard time customizing the graphs, but this  
is perhaps due to my inability to comprehend the online RDocs.

What I want to do is adjust the width / heights of my graphs or at the  
VERY LEAST the heights. It seems that if you scale a graph anywhere  
below 400-450px it is pretty much unreadable, which is very unfortunate  
since I’ve seen so many very nice, small-scale graphs around online  
(such as in web stat packages etc). So the next best thing I think I  
could do help fit into my layout is atleast make my graph wide-screen  
so-to-speak and not as tall as the default height.

I’ve been searching the docs and I’ve seen many methods that regard  
setting height but every attempts I’ve made to implement in my code  
results in errors.

On the topfunky sample side there is a “wide graph” example which is  
basically just wide and not as tall, it is the second example here:

[http://geoffreygrosenbach.com/projects/show/5](http://geoffreygrosenbach.com/projects/show/5)

How do I do that when working with similar but very simple line graphs?  
Given this sample code below, how would I easily modify the height/width  
or make it a widegraph as in the example above? Thanks for any help.

data = [1, 2, 3, 4, 5, 6]

g = Gruff::Line.new(500) #Sets scale to 500px, but I’d like 500 width  
and 300 height  
g.title = “Samplegraph”  
g.labels = {1 =\> “Today”, 3 =\> “Yesterday”, 6 =\> “The Day Before”}  
g.theme\_37signals

g.data(“Graph”, data, ‘#378CDF’)

g.maximum\_value = 10

send\_data(g.to\_blob, :disposition =\> ‘inline’, :type =\> ‘image/png’,  
:filename =\> "sample\_graph.png

---

<div class="post-metadata">

**Author:** ![marstoni](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e9bcb4/32.png) [@marstoni](https://www.ruby-forum.com/u/marstoni)\
**Post date:** [February 4, 2009, 4:52pm UTC](https://www.ruby-forum.com/t/need-some-gruff-graphing-help-custom-dimensions/97185/2 "2009-02-04T16:52:12Z")

</div>

> g = Gruff::Line.new(500) #Sets scale to 500px, but I’d like 500 width  
> and 300 height

g = Gruff::Line.new(“500x300”)
