xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lila Tran <chinaros...@gmail.com>
Subject How come my piechart is gray when using svg
Date Thu, 18 Aug 2005 21:20:59 GMT
I'm trying to save chart as svg, but the piechart is gray even though
the legend is supposed to red.  I even tried to change the section
color, but it doesn't do any good.  When i try to save it as svg or
png, the piechart colors execute just fine, but not sure why the gray
part on my chart when saving just svg.  Please help, below is my
method for savingChar

Below is my method, for some charts it is ok, and for some piecharts
they are not ok.

// saveChartToSVG(), source from online from JFreeChart forum
 public void saveChartToSVG( JFreeChart chart, OutputStream outStream,
     int width, int height ) throws Exception
 {
   if ( chart !=3D null )
   {
     DOMImplementation domImpl =3D
GenericDOMImplementation.getDOMImplementation();
     Document document =3D domImpl.createDocument( null, "svg", null );
     SVGGraphics2D svgGenerator =3D new SVGGraphics2D( document );
     // set the precision to avoid a null pointer exception in Batik 1.5
     svgGenerator.getGeneratorContext().setPrecision(6);
     chart.draw( svgGenerator, new Rectangle2D.Double( 0, 0, width, height=
 ),
         null );
     boolean useCSS =3D true;
     Writer out =3D new OutputStreamWriter( outStream, "UTF-8" );
     svgGenerator.stream( out, useCSS );
     out.close();
   }
 }

If you look at the attachment, you see the gray part of the chart?

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


Mime
View raw message