xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rolf Sigg <rolf.s...@ergon.ch>
Subject SVGGraphics2D omits certain java Arc2D input
Date Thu, 28 Jun 2012 12:08:35 GMT

In our web application, we create dynamic pie charts with JFreeChart. 
Depending on the browser brand and version, we output bitmaps or SVG. 
The SVG code is produced by batik SVGGraphics2D.

We noticed that some pie charts were empty if rendered as SVG but 
showing correctly if rendered as a bitmap (using java 
BufferedImage.createGraphics()). After some investigation I found that 
for the faulty charts, batik produces SVG paths with elliptical arcs 
that have the same start- and end point. The SVG specification states 
that such arcs are omitted 
Therefore, the SVG renderers in the browsers (correctly) skip these path 
segments resulting in faulty chart display.

However, in the Graphics2D API it is ok to represent circles by arcs. 
Arc2D are defined by the bounding rectangle without restriction.

Since the input API of SVGGraphics2D is Graphics2D, I would expect batik 
to generate (visible) SVG representing every valid java input. Therefore 
I think this is a bug in SVGGraphics2D.

Do you agree? Do I miss something?


P.S. Increasing the numeric precision may help in some situations. For 
me this may be a workaround, but not a solution.

rolf.sigg@ergon.ch, +41 44 268 89 00       http://www.ergon.ch
Ergon Informatik AG, Kleinstrasse 15, 8008 Zurich, Switzerland
e r g o n         smart people - smart software

To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org

View raw message