ChartSerializer.Save Method (String)

.NET Framework (current version)

The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Saves chart data and properties with non-default values to the given file.

Namespace:   System.Web.UI.DataVisualization.Charting
Assembly:  System.Web.DataVisualization (in System.Web.DataVisualization.dll)

member Save : 
        fileName:string -> unit


Type: System.String

The relative or absolute path of the file used to store the serialized data. Note that if a relative path is specified, the path will be relative to the current directory.

By default all chart properties with non-default values, which 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.

Note that Write permissions must be enabled for the directory in which the file is stored. By default, this is the Bin folder of the application.

If this method is being used to save Appearance properties as a template, make sure that the IsTemplateMode property is first set to true before calling this method.

Serialization of a chart as a template proceeds differently from non-template serialization, primarily because template serialization concentrates on Appearance properties.

When a template is serialized, the LoadTemplate method can be used to load the template, to provide the Appearance properties for a chart.

Templates can be used to simulate custom palettes.

.NET Framework
Available since 4.0
Return to top