User (Legacy) Posted January 2, 2007 Report Share Posted January 2, 2007 In my case, I want to load a stream containing xml to the chart. If I import the same xml from a file, it works properly. If I read the xml file into a string and then try to convert it to a stream and import the stream, it doesn't work. Of course, your assemblies are obfuscated. So, I can't duplicate what your code is doing when it loads an xml file. It put a sample together to simulate getting the same xml string. This works: chart1.Import(ChartFX.WebForms.FileFormat.Xml, fileName); This does not work: string myxml = ""; string fileName = @"D:\chartsettings.xml"; using(StreamReader sr = new StreamReader(fileName)) { myxml = sr.ReadToEnd(); } using (MemoryStream stream = new MemoryStream()) { using (StreamWriter sw = new StreamWriter(stream)) { sw.Write(myxml); stream.Position = 0; chart1.Import(ChartFX.WebForms.FileFormat.Xml, stream); } } Link to comment Share on other sites More sharing options...
Software FX Posted January 4, 2007 Report Share Posted January 4, 2007 Try calling: sw.Flush(); sw.Close(); BEFORE calling Import. -- Francisco Padron www.chartfx.com Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.