[]
        
(Showing Draft Content)

Save/Load Chart Control

Chart controls can be saved to and loaded from an XML file. This feature is also available from the smart tag of the FpChart control placed on the form.

Using Code

You can load the XML file with the LoadFromTemplate method of the FpChart class and save it to the XML file with the SaveToTemplate method.

Example

The following sample code saves or loads the chart control into an XML file.

string f;
f = "c:\\temp\\chart.xml";
System.IO.FileStream s = new System.IO.FileStream(f, System.IO.FileMode.OpenOrCreate, System.IO.FileAccess.ReadWrite);
fpChart1.SaveToTemplate(s);
//fpChart1.LoadFromTemplate(s);
Dim f As String
f = "c:\chart.xml"
Dim s As New System.IO.FileStream(f, System.IO.FileMode.OpenOrCreate, System.IO.FileAccess.ReadWrite)
FpChart1.SaveToTemplate(s)
'FpChart1.LoadFromTemplate(s)