Chart.LoadTemplate 方法

定义

加载模板至 Chart 控件。Loads a template into the Chart control.

重载

LoadTemplate(String)

从磁盘中加载具有指定文件名的模板。Loads a template with the specified filename from the disk.

LoadTemplate(Stream)

将图像流中的模板加载到 Chart 控件中。Loads a template into the Chart control from an image stream.

LoadTemplate(String)

从磁盘中加载具有指定文件名的模板。Loads a template with the specified filename from the disk.

public:
 void LoadTemplate(System::String ^ name);
public void LoadTemplate (string name);
member this.LoadTemplate : string -> unit
Public Sub LoadTemplate (name As String)

参数

name
String

要加载的模板的文件名。The file name of the template to load. 必须指定要从磁盘加载的模板的完整路径。You must specify the full path of the template to be loaded from the disk.

注解

name参数必须使用完整路径,例如 C:\MyPic.jpg。The name parameter must use a full path, for example, C:\MyPic.jpg. 请注意,还必须指定文件扩展名。Note that you must also specify the file extension.

此方法从使用方法保存的磁盘加载模板 SaveThis method loads a template from disk that was saved using the Save method.

请确保在 IsTemplateMode true 通过方法保存模板之前将属性设置为 SaveMake 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.

适用于

LoadTemplate(Stream)

将图像流中的模板加载到 Chart 控件中。Loads a template into the Chart control from an image stream.

public:
 void LoadTemplate(System::IO::Stream ^ stream);
public void LoadTemplate (System.IO.Stream stream);
member this.LoadTemplate : System.IO.Stream -> unit
Public Sub LoadTemplate (stream As Stream)

参数

stream
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.

请确保在 IsTemplateMode true 通过方法保存模板之前将属性设置为 SaveMake 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.

适用于