Saves all properties of the chart into the file. By setting Content or SerializableContent/NonSerializableContent properties specific set of properties can be saved.
Visual Basic (Usage) | Copy Code |
---|---|
|
Parameters
- fileName
- Relative or absolute pathname of the file used to store the serialized data. To specify a URL use a Server.MapPath statement. Also note that if a relative pathname is used that the pathname will be relative to the current directory.
The file name used to write the data.
Visual Basic | Copy Code |
---|---|
' Save chart appearance properties that have non-default values., as well as axis labels. |
C# | Copy Code |
---|---|
// Save chart appearance properties that have non-default values, as well as axis labels. |
By default all chart properties with non-default values (this includes data points) will be serialized when this method is called. To control chart characteristics to be serialized use the Content, SerializableContent and NonSerializableContent properties.
By default data is saved in an XML format. To save the data in a binary format use the Format property.
Please note that Write permissions must be enabled for the directory the file is stored in (by default the Bin folder of the application).
If this method is being used to save appearance properties as a template then make sure that the TemplateMode property of the ChartSerializer object is first set to true before calling this method.
Serialization of a chart as a template occurs differently then non-template serialization, with template serialization concentrating on appearance properties. In addition, when a template is serialized it can then be loaded to provide the appearance properties for a chart using the Chart.LoadTemplate method method.
Templates can be used to simulate custom palettes.
Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family