You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by ninitha <nc...@inautix.co.in> on 2009/08/31 10:28:48 UTC

How to set Stroke Miter Limit

Hi,

      I am using Batik 1.7 for generating SVG images.(Converting jfreecharts
to SVG images). I want to set the stroke miterlimit value to 1 instead of
10(which is default). Please do let me know how to do this?
The following is the code I use to convert jfreechart chart to SVG image.
Please help me with this as soon as possible.

DOMImplementation dom = GenericDOMImplementation.getDOMImplementation(); 
		Document document =
dom.createDocument(SVGDOMImplementation.SVG_NAMESPACE_URI, "svg", null); 

		SVGGeneratorContext ctx = SVGGeneratorContext.createDefault(document); 
		ctx.setEmbeddedFontsOn(false); 
		boolean textAsShapes = false; 

		SVGGraphics2D g2 = new SVGGraphics2D(ctx, textAsShapes); 
		g2.setSVGCanvasSize(new java.awt.Dimension(height,width)); 
        
		// tell JFreeChart to draw itself into the SVG
		chart.draw(g2, new Rectangle(0, 0, height,width), null); 

		 // Write svg file
        OutputStream outputStream = new FileOutputStream(svgFileName);		
        Writer out = new OutputStreamWriter(outputStream, "UTF-8");
        g2.stream(out, true);						
        outputStream.flush();
        outputStream.close();
-- 
View this message in context: http://www.nabble.com/How-to-set-Stroke-Miter-Limit-tp25219948p25219948.html
Sent from the Batik - Users mailing list archive at Nabble.com.


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


Re: How to set Stroke Miter Limit

Posted by ninitha <nc...@inautix.co.in>.
Thanks thomas..This helped me and I was able to solve my issue... 


thomas.deweese wrote:
> 
> Hi Ninitha,
> 
> ninitha <nc...@inautix.co.in> wrote on 08/31/2009 04:28:48 AM:
> 
>>       I am using Batik 1.7 for generating SVG images.(Converting 
> jfreecharts
>> to SVG images). I want to set the stroke miterlimit value to 1 instead 
> of
>> 10(which is default). Please do let me know how to do this?
> 
>    The stroke miterlimit is set by JFreeChart, the SVG generator simply
> uses the value that JFreeChart specifies.  I think you will be better off
> looking at JFreeChart to see how to tell it what you want drawn rather
> than try to 'fix' it in the SVG output.
> 
>    A search of "JFreeCharg BasicStroke" turned up some stuff that looked
> like it might be helpful.
> 
> 
:-):-):-):-)
-- 
View this message in context: http://www.nabble.com/How-to-set-Stroke-Miter-Limit-tp25219948p25278139.html
Sent from the Batik - Users mailing list archive at Nabble.com.


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


Re: How to set Stroke Miter Limit

Posted by th...@kodak.com.
Hi Ninitha,

ninitha <nc...@inautix.co.in> wrote on 08/31/2009 04:28:48 AM:

>       I am using Batik 1.7 for generating SVG images.(Converting 
jfreecharts
> to SVG images). I want to set the stroke miterlimit value to 1 instead 
of
> 10(which is default). Please do let me know how to do this?

   The stroke miterlimit is set by JFreeChart, the SVG generator simply
uses the value that JFreeChart specifies.  I think you will be better off
looking at JFreeChart to see how to tell it what you want drawn rather
than try to 'fix' it in the SVG output.

   A search of "JFreeCharg BasicStroke" turned up some stuff that looked
like it might be helpful.