| Contents > SharpPlot > Methods | Index |
SharpPlot.RenderVml Method
Return completed chart rendered as Vector Markup (VML).
public string RenderVml();
Return Value
The 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.
Example
string myvml = sp.RenderVml();
Overloads
Working with VML
Please 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.aspx",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
