Bugs: Browse | Submit New | Admin

[#27102] Bug in SVG generation makes graph disappear. Simple patch attached.

Date:
2009-09-14 16:24
Priority:
3
Submitted By:
Stephen Edwards (stephen70edward)
Assigned To:
David Parry (suranyami)
Category:
Rendering
State:
Open
Summary:
Bug in SVG generation makes graph disappear. Simple patch attached.

Detailed description
The viewBox generated by the base renderer is incorrect, making the graphs all but disappear (they're drawn just to
the left of the visible region -- look at the generated .svg file with Inkscape).  According to the SVG spec, the parameters
are <min-x> <min-y> <width> <height>.

In the source I have access to, this is initialized using

 svg.svg(:xmlns => "http://www.w3.org/2000/svg", 'xmlns:xlink' => "http://www.w3.org/1999/xlink",
:viewBox => "#{options[:size].first} 100 #{options[:size].last} 200")

(Line 35 of renderers/base.rb)

It should be something like

svg.svg(:xmlns => "http://www.w3.org/2000/svg", 'xmlns:xlink' => "http://www.w3.org/1999/xlink",
:viewBox => "0 0 #{options[:size].first} #{options[:size].last}")

Add A Comment: Notepad

Please login


Followup

Message
Date: 2009-10-17 02:44
Sender: Seth Jackson

This fixes the problem for me too.
Date: 2009-10-14 13:53
Sender: Mat Schaffer

I put a snapshot release up at
http://dl.getdropbox.com/u/54805/scruffy-0.2.6-matschaffer.gem
incase anyone needs it. Hopefully the next release will include
this as well.
Date: 2009-10-14 13:36
Sender: Nicolas BRIGITTE-ALPHONSINE

my probleme was solve this exact same way too.
Date: 2009-10-14 02:50
Sender: Mat Schaffer

I checked in this fix as rev 66. It seems to get the svgs working
correctly. Tested in safari. Still not sure about rendering to
png since I'm still having some issues with my rmagick
installation.

Attached Files:

Name Description Download
No Files Currently Attached

Changes:

No Changes Have Been Made to This Item