| ||
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 > RenderVml Method SharpPlot.RenderVml MethodReturn completed chart rendered as Vector Markup (VML). public string RenderVml(); Return ValueThe result of this call is a string representation of a partial HTML document. This may be written to file as text, or returned via HTTP as a section in a normal webpage. You may have several VML sections in a single page. They are automatically named with the current chart name if this is set to a non-default value. If your page has any VML content, it must begin with the standard VML header to define the behavior of the <v:xxx> tags to the browser. Examplestring myvml = sp.RenderVml(); Overloads
Sizing the rendered graphicThe default is to express all text sizes and positions in pts (72 pts = 1 inch) and to use pts to give the size of the entire block of VML. If you prefer to use pixels, you can pass the required dpi conversion (passing 96 here will have no visible effect on most video adaptors at default resolution). This allows you to fix the size of the graphic more reliably on websites which use pixels for design reasons. It also allows you to make thumbnails of the charts with no extra processing. Working with VMLPlease note that VML is a Microsoft-specific format and is only supported in Internet Explorer 5.5 and above. However it runs ‘native’ in the browser and can be used to put an entire page inline, rather than required callbacks to the server to obtain charts as SVG or raster images. To make IE understand the VML tags, you MUST include the appropriate behavior tag in the header, so the sample code shown below is typical of what you need to create a functional webpage: // Render to HTML file as VML StreamWriter sw = new StreamWriter("Simple.htm",false,System.Text.Encoding.ASCII); string chart = sp.RenderVml(false); sw.Write("<html>"); sw.Write("<head>"); sw.Write(sp.VmlHeader); // Add the header detail sw.Write("<title>SharpPlot - Simple chart</title>"); sw.Write("</head>"); sw.Write("<body>"); sw.Write(chart); sw.Write("</body>"); sw.Write("</html>"); sw.Close(); This will create a complete page with your chart shown correctly within it. See also ...SharpPlot Members | VmlHeader Property | SaveVml Method | SetChartName Method |