SharpPlot Reference > SharpPlot Methods > RenderSvg Method

SharpPlot.RenderSvg Method

Return completed chart rendered through SVG engine.


string mysvg = sp.RenderSvg(SvgMode.FixedAspect);

Return Value

The result of this call is a string representation of an SVG document. This may be written to file as text for inclusion in a webpage, or returned via HTTP with content type “image/svg+xml”.

Most modern browsers (including Microsoft Internet Explorer 9 – 2011) natively support SVG. So not only they will display SVG files save with SaveSvg, but you can also inline the string returned by RenderSvg directly into you HTML body.

For compatibility with older browsers, you can embed the SVG using the <embed> tag :

<embed src="mychart.svg" height=300 width=640 type="image/svg+xml">


See also ...

SharpPlot Members | SharpPlot.SaveSvg Method

Send comments on this topic
© Dyalog Ltd 2021