Scruffy Graph is Cropped

I’m running the Scruffy example for a line graph from
http://scruffy.rubyforge.org/. My code is

require ‘scruffy’

graph = Scruffy::Graph.new
graph.title = “Sample Line Graph”
graph.renderer = Scruffy::Renderers::Standard.new

graph.add :line, 'Example', [20, 100, 70, 30, 106]

graph.render :to => "line_test.svg"
graph.render  :width => 300, :height => 200,
  :to => "line_test.png", :as => 'png'

The output is severely cropped, showing only an incomplete graph (see
attached .png file).

I’ve played with the :width and :height parameters, but just make things
worse. Can someone shed some light on this?

Thanks,

–Alex DeCaria

Hi Alex,

Did you ever get to the bottom of this? I’m getting the exact same
behaviour.

I’m on Mac OSX.

Perhaps it’s an ImageMagick version type issue?

//matt

Just a check here… am I the Alex you’re addressing? I do recall being
on a Scruffy Graph thread a while back, but don’t recall any specifics.

If I’m the wrong Alex, feel free to disregard. Otherwise, refresh my
memory on the issue? (I’m a list subscriber and so not reading a
threaded version on the website and have no reference to the origin).


Alex S. | Sr. Quality Engineer | hi5 Networks, Inc. | [email protected]
|

Don’t think so, but thanks for the quick reply! Here’s the original
post:


I’m running the Scruffy example for a line graph from
http://scruffy.rubyforge.org/. My code is

require ‘scruffy’

graph = Scruffy::Graph.new
graph.title = “Sample Line Graph”
graph.renderer = Scruffy::Renderers::Standard.new

graph.add :line, 'Example', [20, 100, 70, 30, 106]

graph.render :to => "line_test.svg"
graph.render  :width => 300, :height => 200,
  :to => "line_test.png", :as => 'png'

The output is severely cropped, showing only an incomplete graph (see
attached .png file).

I’ve played with the :width and :height parameters, but just make things
worse. Can someone shed some light on this?

Thanks,

–Alex DeCaria

I found a solution here that worked for me
http://mikegriffin.ie/blog/20110128-cropped-png-and-jpg-graphs-when-using-scruffy

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs