Spread Windows Forms 15.0
Spread Windows Forms 15.0 Product Documentation / Developer's Guide / Chart Control / Creating Charts / Using the Chart Control / Save/Load Chart Control
In This Topic
    Save/Load Chart Control
    In This Topic

    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.


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

    Copy Code
    string f;
    f = "c:\\temp\\chart.xml";
    System.IO.FileStream s = new System.IO.FileStream(f, System.IO.FileMode.OpenOrCreate, System.IO.FileAccess.ReadWrite);
    Visual Basic
    Copy Code
    Dim f As String
    f = "c:\chart.xml"
    Dim s As New System.IO.FileStream(f, System.IO.FileMode.OpenOrCreate, System.IO.FileAccess.ReadWrite)