Saves chart data and properties with non-default values to an object that derives from the Stream class.
Saves all properties of the chart into the stream. By setting Content or SerializableContent/NonSerializableContent properties specific set of properties can be saved.
Visual Basic (Usage) | Copy Code |
---|---|
|
Parameters
- stream
-
An object derived from the Stream class (e.g. MemoryStream) used to save chart properties.
The stream where to save the data.
The following example first serializes all appearance data to a memory stream (only properties with non-default values), and then loads the serialized data. Axis labels are also serialized.
Visual Basic | Copy Code |
---|---|
' Create MemoryStream object |
C# | Copy Code |
---|---|
// Create MemoryStream object |
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.
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.
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