How to serialize all the teechart
Posted: Thu Dec 20, 2007 2:52 am
Hi actually Im develop with TeeChart, and I need to save to an XML my Chart but when i use:
System.IO.MemoryStream fs = new System.IO.MemoryStream();
Steema.TeeChart.Export.DataExport dataExport = new Steema.TeeChart.Export.DataExport(graphic.Chart);
dataExport.XML.IncludeHeader = true;
dataExport.XML.IncludeIndex = true;
dataExport.XML.IncludeLabels = true;
dataExport.XML.IncludeSeriesTitle = true;
dataExport.XML.Save(fs);
fs.Flush();
XmlDocument xmlPanel = new XmlDocument();
fs.Seek(0, System.IO.SeekOrigin.Begin);
xmlPanel.Load(fs);
fs.Close();
I only save the data, labels, index and headers. So I need to save the colors the position the rotation, and too much information, so How I can save all the information for latter save all this in a XML
Later When I load the information I do the next
XmlDocument xmlMain = new XmlDocument();
XmlNode nodeImp = xmlMain.ImportNode(nodeGraph, true);
xmlMain.AppendChild(nodeImp);
System.IO.MemoryStream ms = new System.IO.MemoryStream();
xmlMain.Save(ms);
string s = xmlMain.InnerXml;
ms.Flush();
ms.Seek(0, System.IO.SeekOrigin.Begin);
ms.Position = 0;
Steema.TeeChart.Import.Imports();
graphic.Chart.Import.Template.Load(ms);
graphic.Import.Template.Load(ms);
graphic.Refresh();
But it send an error to say that couldn't load binary data.
Please What can I do to solve my problem..
System.IO.MemoryStream fs = new System.IO.MemoryStream();
Steema.TeeChart.Export.DataExport dataExport = new Steema.TeeChart.Export.DataExport(graphic.Chart);
dataExport.XML.IncludeHeader = true;
dataExport.XML.IncludeIndex = true;
dataExport.XML.IncludeLabels = true;
dataExport.XML.IncludeSeriesTitle = true;
dataExport.XML.Save(fs);
fs.Flush();
XmlDocument xmlPanel = new XmlDocument();
fs.Seek(0, System.IO.SeekOrigin.Begin);
xmlPanel.Load(fs);
fs.Close();
I only save the data, labels, index and headers. So I need to save the colors the position the rotation, and too much information, so How I can save all the information for latter save all this in a XML
Later When I load the information I do the next
XmlDocument xmlMain = new XmlDocument();
XmlNode nodeImp = xmlMain.ImportNode(nodeGraph, true);
xmlMain.AppendChild(nodeImp);
System.IO.MemoryStream ms = new System.IO.MemoryStream();
xmlMain.Save(ms);
string s = xmlMain.InnerXml;
ms.Flush();
ms.Seek(0, System.IO.SeekOrigin.Begin);
ms.Position = 0;
Steema.TeeChart.Import.Imports();
graphic.Chart.Import.Template.Load(ms);
graphic.Import.Template.Load(ms);
graphic.Refresh();
But it send an error to say that couldn't load binary data.
Please What can I do to solve my problem..