Hi Nick,
Nick Stuart wrote:
[...] It needs to have a width and height in the
<svg> root.
[...] when I try to do this through code:
//this is after the image is generated from JFree chart.
Element root = svgGenerator.getRoot();
svgGenerator.getRoot(root);
root.setAttributeNS(null, "width", "14cm");
root.setAttributeNS(null, "height", "14cm");
When you call 'getRoot' the svgGenerator gives it to you. It no longer remembers the content under that root.
Here's how the image is written out:
Writer out = new OutputStreamWriter(
new FileOutputStream(file), "UTF-8");
svgGenerator.stream(out, useCSS);
out.close();
One option is to use 'stream(Element svgRoot, Writer w, boolean useCSS)'.
The other better option is to call
setSVGCanvasSize(Dimension svgCanvasSize)
Before you start drawing with your desired canvas size.--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
