Chart.LoadTemplate Method (Stream)

.NET Framework (current version)

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

Loads a template into the Chart control from an image stream.

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

public void LoadTemplate(
	Stream stream


Type: System.IO.Stream

The stream to load from.

Use this method if you want to load a template from a stream, such as a memory stream, file stream, and so forth.

Make sure to set the IsTemplateMode property to true before saving the template with the Save method.

If a loaded template has two data series, the appearance properties of the series are applied sequentially to the chart. In other words, the first template series appearance properties are assigned to the first series of the chart, the second template series appearance properties are applied to the second series of the chart, then the first template series is used again for the third series of the chart, and so on. The same holds true for chart areas, and any other collections that have appearance properties.

Templates can be used to simulate custom palettes.

.NET Framework
Available since 4.0
Return to top