# Scruffy \> MVC architecture?

**URL:** <https://www.ruby-forum.com/t/scruffy-mvc-architecture/119248>\
**Category:** Rails\
**Created:** [November 5, 2007, 12:13pm UTC](https://www.ruby-forum.com/t/scruffy-mvc-architecture/119248 "2007-11-05T12:13:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![remco](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/9d8465/32.png) [@remco](https://www.ruby-forum.com/u/remco)\
**Post date:** [November 5, 2007, 12:13pm UTC](https://www.ruby-forum.com/t/scruffy-mvc-architecture/119248/1 "2007-11-05T12:13:54Z")

</div>

Hi,

I am a newby in rails…and i have read that scruffy is a great tool to  
create/display images.

Now i find the code below for example…

graph = Scruffy::Graph.new  
graph.title = “Comparative Agent Performance”  
graph.value\_formatter = Scruffy::Formatters::Percentage.new(:precision  
=\> 0)  
graph.add :stacked do |stacked|  
stacked.add :bar, ‘Jack’, [30, 60, 49, 29, 100, 120]  
stacked.add :bar, ‘Jill’, [120, 240, 0, 100, 140, 20]  
stacked.add :bar, ‘Hill’, [10, 10, 90, 20, 40, 10]  
end  
graph.point\_markers = [‘Jan’, ‘Feb’, ‘Mar’, ‘Apr’, ‘May’, ‘Jun’]

graph.render(:width =\> 800, :as =\> â€˜JPGâ€™)

But how must i place this in the MVC architecture??

Grtz…remco

---

<div class="post-metadata">

**Author:** ![remco](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/9d8465/32.png) [@remco](https://www.ruby-forum.com/u/remco)\
**Post date:** [January 25, 2008, 1:29pm UTC](https://www.ruby-forum.com/t/scruffy-mvc-architecture/119248/2 "2008-01-25T13:29:07Z")

</div>

Hi,

I noticed your post on Google G. (but I couldnt reply to your post  
there for some reason). The following example works for me:

send\_data(graph.render(:width =\> 500, :as =\> ‘PNG’),  
:type =\> “image/png”,  
:disposition =\> ‘inline’)

Hope this helps,  
Roel

On Nov 5 2007, 12:13 pm, Remco S. \<rails-mailing-l…@andreas-
