| ||
Introducing SharpPlot Your First Chart Recent Updates Sample Charts Tutorials General Tutorials Chart Tutorials SharpPlot Class Properties Structures Enumerations Style examples Glossaries Active Charts VectorMath Class DBUtil Class Get SharpPlot Download SharpPlot Buying SharpPlot SharpPlot Support Upgrading from GraPL Release notes |
Reference > Methods > RenderSvg Method SharpPlot.RenderSvg MethodReturn completed chart rendered through SVG engine. Examplestring mysvg = sp.RenderSvg(SvgMode.FixedAspect); Return ValueThe 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”. It requires the free SVG plugin from Adobe for display in IE, but will display native in Firefox. Overloads
Working with SVGTypically, you would return the SVG directly to the browser, but you may save a stand-alone text file with a simple fragment of C# code such as: // Render to SVG file as ASCII StreamWriter sw = new StreamWriter("Simple.svg",false,System.Text.Encoding.ASCII); string chart = sp.RenderSvg(SvgMode.FixedAspect); sw.Write(chart); sw.Close(); This file will open in FireFox or Internet Explorer (with the Adobe plugin) and the graphic will scale to give you the best fit in the browser window. See also ...SharpPlot Members | SaveSvg Method |