linsiyong Posted April 2, 2010 Report Posted April 2, 2010 I want to get the svg file From Chart,but i can not want to make a aspx page and access this page and then get the file from the chartFx7/temp documnent.So I make a Consoleapplication and write this source: Chart chart1 = new Chart(); chart1.Gallery = Gallery.Lines; chart1.Height = 600; chart1.Width = 600; chart1.ID = "test"; StringBuilder sb = new StringBuilder(); System.IO.StringWriter oStringWriter = new System.IO.StringWriter(sb); System.Web.UI.HtmlTextWriter oWriter = new System.Web.UI.HtmlTextWriter(oStringWriter); chart1.RenderFormat = "SVG"; SvgWriter svgWriter = new SvgWriter(); svgWriter.PluginPage = "http://www.softwarefx.com/svg/svgviewer/"; chart1.OutputWriter = svgWriter; chart1.RenderControl(oWriter); String a = sb.ToString(); =================== when it runs at "chart1.RenderControl(oWriter);" i get a nullpointexception. what is wrong about this source Quote
juanZ Posted April 12, 2010 Report Posted April 12, 2010 Hi I created an empty aspnet page and in the page load I coded the following: using ChartFX.WebForms;using ChartFX.WebForms.Writer.Svg; .......... on Page Load method ....... Chart chart1 = new Chart(); chart1.Gallery = Gallery.Bar; chart1.Data.Points = 3; chart1.Data.Series = 1; chart1.Data[0, 0] = 30; chart1.Data[0, 1] = 60; chart1.Data[0, 2] = 90; chart1.Height = 600; chart1.Width = 600; chart1.ID = "test"; chart1.ImageSettings.Interactive = false; chart1.RenderFormat = "SVG"; SvgWriter svgWriter = new SvgWriter(); chart1.OutputWriter = svgWriter; chart1.RenderControl(); I also installed the SVG viewer component from Adobe: http://www.adobe.com/svg/viewer/install/ Hope this helps. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.