Class ChartTemplateDocument
Represents an ODF chart template document (OTC). 表示 ODF 圖表範本文件(OTC)。
public sealed class ChartTemplateDocument : ChartDocument, IDisposable, IAsyncDisposable
- Inheritance
-
ChartTemplateDocument
- Implements
- Inherited Members
Constructors
ChartTemplateDocument(OdfPackage)
Initializes a new instance of the ChartTemplateDocument class with the specified ODF package. 使用指定的 ODF 封裝初始化 ChartTemplateDocument 類別的新執行個體。
public ChartTemplateDocument(OdfPackage package)
Parameters
packageOdfPackageThe ODF package instance. / ODF 封裝執行個體。
ChartTemplateDocument(OdfPackage, string)
Initializes a new instance of the ChartTemplateDocument class with the specified ODF package and sub-path. 使用指定的 ODF 封裝與子路徑初始化 ChartTemplateDocument 類別的新執行個體。
public ChartTemplateDocument(OdfPackage package, string subPath)
Parameters
packageOdfPackageThe ODF package instance. / ODF 封裝執行個體。
subPathstringThe sub-path within the package. / 封裝內的子路徑。
Methods
Create()
Creates a new OTC chart template document. 建立新的 OTC 圖表範本文件。
public static ChartTemplateDocument Create()
Returns
- ChartTemplateDocument
A new ChartTemplateDocument instance. / 新的 ChartTemplateDocument 執行個體。
CreateFromDocument(ChartDocument)
Creates a new OTC chart template document from an existing ODC chart document, fully preserving its chart definition, series, and styles. 從現有的 ODC 圖表文件建立新的 OTC 圖表範本文件,完整保留其圖表定義、序列與樣式。
public static ChartTemplateDocument CreateFromDocument(ChartDocument document)
Parameters
documentChartDocumentThe chart document used as the template content source. / 作為範本內容來源的圖表文件。
Returns
- ChartTemplateDocument
The created ChartTemplateDocument instance. / 建立完成的 ChartTemplateDocument 執行個體。
Load(Stream)
Loads an OTC chart template document from the specified stream. 從指定資料流載入 OTC 圖表範本文件。
public static ChartTemplateDocument Load(Stream stream)
Parameters
streamStream
Returns
- ChartTemplateDocument
The loaded ChartTemplateDocument instance. / 載入完成的 ChartTemplateDocument 執行個體。
Load(Stream, string?)
Short overload of Load that accepts stream and fileName; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 stream 與 fileName;其餘可選參數使用預設值並轉呼叫最長 Load 多載。
public static ChartTemplateDocument Load(Stream stream, string? fileName)
Parameters
Returns
Load(string)
Loads an OTC chart template document from the specified path. 從指定路徑載入 OTC 圖表範本文件。
public static ChartTemplateDocument Load(string path)
Parameters
pathstringThe OTC document path. / OTC 文件路徑。
Returns
- ChartTemplateDocument
The loaded ChartTemplateDocument instance. / 載入完成的 ChartTemplateDocument 執行個體。
LoadAsync(Stream)
Asynchronously loads an OTC chart template document from the specified stream. 非同步從指定資料流載入 OTC 圖表範本文件。
public static Task<ChartTemplateDocument> LoadAsync(Stream stream)
Parameters
streamStream
Returns
- Task<ChartTemplateDocument>
A task representing the asynchronous load operation, whose result is the loaded ChartTemplateDocument. / 代表非同步載入作業的工作,其結果為載入完成的 ChartTemplateDocument。
LoadAsync(Stream, string?)
Short overload of LoadAsync that accepts stream and fileName; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 stream 與 fileName;其餘可選參數使用預設值並轉呼叫最長 LoadAsync 多載。
public static Task<ChartTemplateDocument> LoadAsync(Stream stream, string? fileName)
Parameters
Returns
LoadAsync(Stream, string?, CancellationToken)
Short overload of LoadAsync that accepts stream, fileName, and cancellationToken; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 stream、fileName 與 cancellationToken;其餘可選參數使用預設值並轉呼叫最長 LoadAsync 多載。
public static Task<ChartTemplateDocument> LoadAsync(Stream stream, string? fileName, CancellationToken cancellationToken)
Parameters
streamStreamfileNamestringcancellationTokenCancellationToken
Returns
LoadAsync(Stream, CancellationToken)
Asynchronously loads the document from a stream with a cancellation token. 以取消語彙基元非同步從資料流載入文件。
public static Task<ChartTemplateDocument> LoadAsync(Stream stream, CancellationToken cancellationToken)
Parameters
streamStreamThe document stream. / 文件資料流。
cancellationTokenCancellationTokenThe cancellation token. / 取消語彙基元。
Returns
- Task<ChartTemplateDocument>
A task whose result is the loaded document. / 代表非同步載入作業的工作,其結果為載入完成的文件。
LoadAsync(string)
Asynchronously loads an OTC chart template document from the specified path. 非同步從指定路徑載入 OTC 圖表範本文件。
public static Task<ChartTemplateDocument> LoadAsync(string path)
Parameters
pathstring
Returns
- Task<ChartTemplateDocument>
A task representing the asynchronous load operation, whose result is the loaded ChartTemplateDocument. / 代表非同步載入作業的工作,其結果為載入完成的 ChartTemplateDocument。
LoadAsync(string, CancellationToken)
Short overload of LoadAsync that accepts path and cancellationToken; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 path 與 cancellationToken;其餘可選參數使用預設值並轉呼叫最長 LoadAsync 多載。
public static Task<ChartTemplateDocument> LoadAsync(string path, CancellationToken cancellationToken)
Parameters
pathstringcancellationTokenCancellationToken