Class OdfChartDocument
Provides the OdfChartDocument API. 提供 OdfChartDocument API。
public class OdfChartDocument : OdfDocument, IDisposable, IAsyncDisposable
- Inheritance
-
OdfChartDocument
- Implements
- Derived
- Inherited Members
Constructors
OdfChartDocument(OdfPackage)
Initializes a new instance of the OdfChartDocument class. 初始化 OdfChartDocument 類別的新執行個體。
public OdfChartDocument(OdfPackage package)
Parameters
packageOdfPackage
OdfChartDocument(OdfPackage, string)
Represents an ODF chart document. 表示 ODF 圖表文件(Chart Document)的類別。
public OdfChartDocument(OdfPackage package, string subPath)
Parameters
packageOdfPackageThe ODF package instance. / Odf 套件執行個體。
subPathstringThe sub-path. / 子路徑。
Properties
CategoriesCellRangeAddress
Gets or sets the cell range address of the X-axis category labels. 取得或設定 X 軸分類標籤的儲存格範圍位址。
public string? CategoriesCellRangeAddress { get; set; }
Property Value
ChartClass
Gets or sets the chart class (type). 取得或設定圖表類型。
public string ChartClass { get; set; }
Property Value
ChartNode
Gets the main chart node. 取得主要圖表節點。
public OdfNode ChartNode { get; }
Property Value
- OdfNode
ChartTitle
Gets or sets the chart title. 取得或設定圖表標題。
public string? ChartTitle { get; set; }
Property Value
DataSourceHasLabels
Gets or sets whether the chart data source includes labels. 取得或設定圖表資料來源是否包含標籤。
public string? DataSourceHasLabels { get; set; }
Property Value
Remarks
ODF 允許的常見值包含 none、row、column 與 both
GridStyle
Gets or sets the chart automatic style of the primary Y-axis grid lines. 取得或設定主要 Y 軸格線的圖表自動樣式。
public OdfChartStyle GridStyle { get; set; }
Property Value
Legend
Gets the unified editable model of the legend. 取得圖例的統一可編輯模型。
public OdfChartLegend Legend { get; }
Property Value
LegendAlignment
Gets or sets the legend alignment (corresponding to chart:legend-align).
取得或設定圖例的對齊方式(對應 chart:legend-align)。
public string? LegendAlignment { get; set; }
Property Value
Remarks
常見值包含 start、center 與 end
LegendPosition
Gets or sets the legend position. 取得或設定圖例位置。
public string? LegendPosition { get; set; }
Property Value
Remarks
常見值包含 top、bottom、start 與 end
LegendStyle
Gets or sets the chart automatic style of the legend (background color, border, etc.). 取得或設定圖例的圖表自動樣式(背景色、邊框等)。
public OdfChartStyle LegendStyle { get; set; }
Property Value
PlotAreaStyle
Gets or sets the chart automatic style of the plot area. 取得或設定繪圖區的圖表自動樣式。
public OdfChartStyle PlotAreaStyle { get; set; }
Property Value
Series
Gets a summary of the data series in the chart. 取得圖表中的資料序列摘要。
public IReadOnlyList<OdfChartSeriesInfo> Series { get; }
Property Value
SeriesCount
Gets the number of data series in the chart. 取得圖表中的資料序列數量。
public int SeriesCount { get; }
Property Value
XAxisTitle
Gets or sets the X-axis title. 取得或設定 X 軸標題。
public string? XAxisTitle { get; set; }
Property Value
YAxisTitle
Gets or sets the Y-axis title. 取得或設定 Y 軸標題。
public string? YAxisTitle { get; set; }
Property Value
Methods
AddLight(string)
Short overload of AddLight that accepts direction; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 direction;其餘可選參數使用預設值並轉呼叫最長 AddLight 多載。
public void AddLight(string direction)
Parameters
directionstring
AddLight(string, string?)
Short overload of AddLight that accepts direction and diffuseColor; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 direction 與 diffuseColor;其餘可選參數使用預設值並轉呼叫最長 AddLight 多載。
public void AddLight(string direction, string? diffuseColor)
Parameters
AddLight(string, string?, bool?)
Short overload of AddLight that accepts direction, diffuseColor, and enabled; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 direction、diffuseColor 與 enabled;其餘可選參數使用預設值並轉呼叫最長 AddLight 多載。
public void AddLight(string direction, string? diffuseColor, bool? enabled)
Parameters
AddLight(string, string?, bool?, bool?)
Adds a 3D chart light source (dr3d:light).
新增一個 3D 圖表光源(dr3d:light)。
public void AddLight(string direction, string? diffuseColor, bool? enabled, bool? specular)
Parameters
directionstringThe light direction vector, formatted as
(x y z). / 光源方向向量,格式為(x y z)。diffuseColorstringThe optional diffuse color. / 選用的漫射色。
enabledbool?The optional enabled state. / 選用的啟用狀態。
specularbool?The optional specular reflection enabled state. / 選用的反射光啟用狀態。
Exceptions
- ArgumentException
Thrown when
directionis blank. / 當direction為空白時擲出。
AddSeries(string)
Short overload of AddSeries that accepts valuesCellRangeAddress; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 valuesCellRangeAddress;其餘可選參數使用預設值並轉呼叫最長 AddSeries 多載。
public OdfNode AddSeries(string valuesCellRangeAddress)
Parameters
valuesCellRangeAddressstring
Returns
- OdfNode
AddSeries(string, string?)
Adds a placeholder data series node. 新增資料序列佔位節點。
public OdfNode AddSeries(string valuesCellRangeAddress, string? labelCellAddress)
Parameters
valuesCellRangeAddressstringThe data value cell range address. / 資料值儲存格範圍位址。
labelCellAddressstringThe optional label cell address. / 選用的標籤儲存格位址。
Returns
- OdfNode
The newly added series node. / 新增的序列節點。
Apply3DOptions(OdfChart3DOptions)
Applies practical 3D chart options to the plot area and automatic styles. 將實務 3D 圖表選項套用至繪圖區與自動樣式。
public void Apply3DOptions(OdfChart3DOptions options)
Parameters
optionsOdfChart3DOptionsThe 3D options to apply. / 要套用的 3D 選項。
Exceptions
ApplyDefinition(OdfChartDefinition)
Applies an OdfChartDefinition to the current chart. 將 OdfChartDefinition 套用至目前圖表。
public void ApplyDefinition(OdfChartDefinition definition)
Parameters
definitionOdfChartDefinitionThe chart definition. / 圖表定義。
ApplyStockMarkerStyle(OdfStockMarkerStyle)
Applies practical stock marker styles to the current chart. 將實務股票圖標記樣式套用至目前圖表。
public void ApplyStockMarkerStyle(OdfStockMarkerStyle style)
Parameters
styleOdfStockMarkerStyleThe stock marker style. / 股票圖標記樣式。
Exceptions
ClearLights()
Removes all 3D chart light sources from the plot area. 移除繪圖區中所有 3D 圖表光源。
public void ClearLights()
ClearSeries()
Removes all data series nodes from the chart. 清除圖表中所有資料序列節點。
public void ClearSeries()
Create()
Creates a new ODC chart document. 建立新的 ODC 圖表文件。
public static OdfChartDocument Create()
Returns
- OdfChartDocument
A new OdfChartDocument instance. / 新的 OdfChartDocument 執行個體。
CreateChartStyle(string)
Creates or gets the chart automatic style with the specified name. 建立或取得指定名稱的圖表自動樣式。
public OdfChartStyle CreateChartStyle(string name)
Parameters
namestringThe style name. / 樣式名稱。
Returns
- OdfChartStyle
The editable chart style object. / 可編輯的圖表樣式物件。
Exceptions
- ArgumentException
Thrown when
nameis blank. / 當name為空白時擲出。- InvalidOperationException
Thrown when the name is already used by a non-chart style. / 當名稱已被非圖表樣式使用時擲出。
FindAxisInfo(string)
Finds summary information for the axis of the specified dimension. 尋找指定維度座標軸的摘要資訊。
public OdfChartAxisInfo? FindAxisInfo(string dimension)
Parameters
dimensionstringThe axis dimension, e.g.
x,y, orz. / 座標軸維度,例如x、y或z。
Returns
- OdfChartAxisInfo
The axis summary; null if it does not exist. / 座標軸摘要;若不存在則為 null。
FindAxisTitle(string)
Finds the title of the axis for the specified dimension. 尋找指定維度座標軸的標題。
public string? FindAxisTitle(string dimension)
Parameters
dimensionstringThe axis dimension, e.g. x, y, or z. / 座標軸維度,例如 x、y 或 z。
Returns
FindSeriesDataLabels(int)
Finds the data label setting for the specified data series. 尋找指定資料序列的數據標籤設定。
public OdfChartDataLabelInfo? FindSeriesDataLabels(int seriesIndex)
Parameters
seriesIndexintThe zero-based series index. / 序列索引(從 0 起算)。
Returns
- OdfChartDataLabelInfo
The data label setting; null if the series does not define one. / 數據標籤設定;若序列未定義數據標籤則為 null。
Exceptions
- ArgumentOutOfRangeException
Thrown when
seriesIndexis out of range. / 當seriesIndex超出範圍時擲出。
GetAxisNumberFormat(string)
Gets the number format data style name for the specified axis. 取得指定座標軸的數字格式資料樣式名稱。
public string? GetAxisNumberFormat(string dimension)
Parameters
dimensionstringThe axis dimension. / 座標軸維度。
Returns
GetBubbleSeries()
Gets bubble chart series summaries from the current chart. 從目前圖表取得泡泡圖序列摘要。
public IReadOnlyList<OdfBubbleChartSeriesInfo> GetBubbleSeries()
Returns
- IReadOnlyList<OdfBubbleChartSeriesInfo>
The bubble chart series summaries. / 泡泡圖序列摘要。
GetChartDefinition()
Gets the configuration definition information for the current chart. 取得目前圖表的設定定義資訊。
public OdfChartDefinition GetChartDefinition()
Returns
- OdfChartDefinition
An OdfChartDefinition instance containing the chart properties. / 包含圖表屬性的 OdfChartDefinition 執行個體。
GetChartStyles()
Gets a summary list of all chart automatic styles in the document. 取得文件中所有圖表自動樣式的摘要清單。
public IReadOnlyList<OdfChartStyleInfo> GetChartStyles()
Returns
- IReadOnlyList<OdfChartStyleInfo>
The chart style summary list. / 圖表樣式摘要清單。
GetDataRange()
Gets the spreadsheet cell range currently bound to the chart. 取得圖表目前綁定的試算表儲存格範圍。
public (string? SheetName, OdfCellRange? Range) GetDataRange()
Returns
- (string SheetName, OdfCellRange? Range)
A tuple of the sheet name and cell range; both are null if not set. / 工作表名稱與儲存格範圍的元組;若未設定則兩者均為 null。
GetDefaultContentXml()
Gets the default content XML string. 取得預設的內容 XML 字串。
protected override string GetDefaultContentXml()
Returns
- string
The default content XML string. / 預設的內容 XML 字串。
GetDefaultStylesXml()
Gets the default styles XML string. 取得預設的樣式 XML 字串。
protected override string GetDefaultStylesXml()
Returns
- string
The default styles XML string. / 預設的樣式 XML 字串。
GetFloorStyleName()
Gets the style name of the 3D chart floor (chart:floor). 取得 3D 圖表地板(chart:floor)的樣式名稱。
public string? GetFloorStyleName()
Returns
GetLights()
Gets a summary list of all light sources (dr3d:light) in the 3D chart plot area.
取得 3D 圖表繪圖區中所有光源(dr3d:light)的摘要清單。
public IReadOnlyList<OdfChartLightInfo> GetLights()
Returns
- IReadOnlyList<OdfChartLightInfo>
The light source summary list, in document order. / 光源摘要清單,依文件中出現順序排列。
GetLocalDataCache()
Gets a lazily loaded snapshot of the chart's embedded local data table. 取得圖表內嵌本地資料表的延遲載入快照。
public OdfChartDataCache GetLocalDataCache()
Returns
- OdfChartDataCache
The local data table snapshot; an empty snapshot if the chart has no embedded data table. / 本地資料表快照;若圖表沒有內嵌資料表,則回傳空快照。
GetSeriesEditor(int)
Gets the editable data series at the specified index. 取得指定索引的可編輯資料序列。
public OdfChartSeries GetSeriesEditor(int index)
Parameters
indexintThe zero-based series index. / 序列索引(從 0 起算)。
Returns
- OdfChartSeries
The editable series object. / 可編輯的序列物件。
Exceptions
- ArgumentOutOfRangeException
Thrown when the index is out of range. / 索引超出範圍時擲出。
GetStockGainMarkerStyleName()
Gets the style name of the stock chart gain marker (chart:stock-gain-marker). 取得股票圖上漲標記(chart:stock-gain-marker)的樣式名稱。
public string? GetStockGainMarkerStyleName()
Returns
GetStockLossMarkerStyleName()
Gets the style name of the stock chart loss marker (chart:stock-loss-marker). 取得股票圖下跌標記(chart:stock-loss-marker)的樣式名稱。
public string? GetStockLossMarkerStyleName()
Returns
GetStockRangeLineStyleName()
Gets the style name of the stock chart range line (chart:stock-range-line). 取得股票圖範圍線(chart:stock-range-line)的樣式名稱。
public string? GetStockRangeLineStyleName()
Returns
GetStockSeries()
Gets stock chart series summaries from the current chart. 從目前圖表取得股票圖序列摘要。
public IReadOnlyList<OdfStockChartSeriesInfo> GetStockSeries()
Returns
- IReadOnlyList<OdfStockChartSeriesInfo>
The stock chart series summaries. / 股票圖序列摘要。
GetWallStyleName()
Gets the style name of the 3D chart wall (chart:wall). 取得 3D 圖表牆面(chart:wall)的樣式名稱。
public string? GetWallStyleName()
Returns
InvalidateLocalDataCache()
Clears the chart's local data snapshot so the next read rescans the current DOM. 清除圖表本地資料快照,讓下一次讀取重新掃描目前 DOM。
protected void InvalidateLocalDataCache()
Load(Stream)
Loads an ODC chart document from the specified stream. 從指定資料流載入 ODC 圖表文件。
public static OdfChartDocument Load(Stream stream)
Parameters
streamStream
Returns
- OdfChartDocument
The loaded OdfChartDocument instance. / 載入完成的 OdfChartDocument 執行個體。
Exceptions
- InvalidOperationException
When the specified document is not an ODC chart. / 當指定文件不是 ODC 圖表時擲出。
Load(Stream, string?)
Full overload of Load that accepts stream and fileName. Load 完整多載:接受 stream 與 fileName。
public static OdfChartDocument Load(Stream stream, string? fileName)
Parameters
Returns
Load(string)
Loads an ODC chart document from the specified path. 從指定路徑載入 ODC 圖表文件。
public static OdfChartDocument Load(string path)
Parameters
pathstringThe ODC document path. / ODC 文件路徑。
Returns
- OdfChartDocument
The loaded OdfChartDocument instance. / 載入完成的 OdfChartDocument 執行個體。
Exceptions
- InvalidOperationException
When the specified document is not an ODC chart. / 當指定文件不是 ODC 圖表時擲出。
LoadAsync(Stream)
Asynchronously loads an ODC chart document from the specified stream. 非同步從指定資料流載入 ODC 圖表文件。
public static Task<OdfChartDocument> LoadAsync(Stream stream)
Parameters
streamStream
Returns
- Task<OdfChartDocument>
A task representing the asynchronous load operation, whose result is the loaded OdfChartDocument. / 代表非同步載入作業的工作,其結果為載入完成的 OdfChartDocument。
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<OdfChartDocument> 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<OdfChartDocument> 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<OdfChartDocument> LoadAsync(Stream stream, CancellationToken cancellationToken)
Parameters
streamStreamThe document stream. / 文件資料流。
cancellationTokenCancellationTokenThe cancellation token. / 取消語彙基元。
Returns
- Task<OdfChartDocument>
A task whose result is the loaded document. / 代表非同步載入作業的工作,其結果為載入完成的文件。
LoadAsync(string)
Asynchronously loads an ODC chart document from the specified path. 非同步從指定路徑載入 ODC 圖表文件。
public static Task<OdfChartDocument> LoadAsync(string path)
Parameters
pathstring
Returns
- Task<OdfChartDocument>
A task representing the asynchronous load operation, whose result is the loaded OdfChartDocument. / 代表非同步載入作業的工作,其結果為載入完成的 OdfChartDocument。
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<OdfChartDocument> LoadAsync(string path, CancellationToken cancellationToken)
Parameters
pathstringcancellationTokenCancellationToken
Returns
MergeContentNodes(OdfDocument, OdfMergeOptions, Dictionary<string, string>)
Merges the content nodes of a source document into this document. 合併來源文件的內容節點至本文件中。
protected override void MergeContentNodes(OdfDocument sourceDoc, OdfMergeOptions options, Dictionary<string, string> renameMap)
Parameters
sourceDocOdfDocumentThe source ODF document. / 來源 ODF 文件。
optionsOdfMergeOptionsThe merge options. / 合併設定選項。
renameMapDictionary<string, string>The dictionary mapping renamed style names. / 樣式名稱變更的對照字典。
RemoveChartStyle(string)
Removes the chart automatic style with the specified name. 移除指定名稱的圖表自動樣式。
public bool RemoveChartStyle(string name)
Parameters
namestringThe style name. / 樣式名稱。
Returns
- bool
true if removed successfully; false if not found or not a chart style. / 若成功移除則為 true;找不到或非圖表樣式時為 false。
SetAxisDisplayLabels(string, bool?)
Sets whether the axis of the specified dimension displays scale labels. 設定指定維度座標軸是否顯示刻度標籤。
public void SetAxisDisplayLabels(string dimension, bool? displayLabels)
Parameters
dimensionstringThe axis dimension. / 座標軸維度。
displayLabelsbool?The display labels setting; null removes the attribute. / 顯示標籤設定;null 表示移除屬性。
SetAxisGrid(string, OdfChartGridKind, bool)
Sets the grid line visibility of the axis for the specified dimension. 設定指定維度座標軸的網格線可見性。
public void SetAxisGrid(string dimension, OdfChartGridKind gridKind, bool visible)
Parameters
dimensionstringThe axis dimension. / 座標軸維度。
gridKindOdfChartGridKindThe grid line kind. / 網格線類型。
visibleboolWhether the grid line is displayed. / 是否顯示。
SetAxisLogarithmic(string, bool?)
Sets whether the axis of the specified dimension uses a logarithmic scale. 設定指定維度座標軸是否採用對數刻度。
public void SetAxisLogarithmic(string dimension, bool? logarithmic)
Parameters
dimensionstringThe axis dimension. / 座標軸維度。
logarithmicbool?The logarithmic scale setting; null removes the attribute. / 對數刻度設定;null 表示移除屬性。
SetAxisMaximum(string, double?)
Sets the maximum scale value of the axis for the specified dimension. 設定指定維度座標軸的刻度最大值。
public void SetAxisMaximum(string dimension, double? maximum)
Parameters
dimensionstringThe axis dimension. / 座標軸維度。
maximumdouble?The maximum value; null removes the attribute. / 最大值;null 表示移除屬性。
SetAxisMinimum(string, double?)
Sets the minimum scale value of the axis for the specified dimension. 設定指定維度座標軸的刻度最小值。
public void SetAxisMinimum(string dimension, double? minimum)
Parameters
dimensionstringThe axis dimension. / 座標軸維度。
minimumdouble?The minimum value; null removes the attribute. / 最小值;null 表示移除屬性。
SetAxisNumberFormat(string, string?)
Sets the number format data style name for the specified axis. 設定指定座標軸的數字格式資料樣式名稱。
public void SetAxisNumberFormat(string dimension, string? dataStyleName)
Parameters
dimensionstringThe axis dimension. / 座標軸維度。
dataStyleNamestringThe data style name; blank removes the setting. / 資料樣式名稱;空白值會移除設定。
SetAxisReverseDirection(string, bool?)
Sets whether the axis of the specified dimension is displayed in reverse direction. 設定指定維度座標軸是否反向顯示。
public void SetAxisReverseDirection(string dimension, bool? reverseDirection)
Parameters
dimensionstringThe axis dimension. / 座標軸維度。
reverseDirectionbool?The reverse direction setting; null removes the attribute. / 反向顯示設定;null 表示移除屬性。
SetAxisStyleName(string, string?)
Sets the style name of the axis for the specified dimension. 設定指定維度座標軸的樣式名稱。
public void SetAxisStyleName(string dimension, string? styleName)
Parameters
dimensionstringThe axis dimension. / 座標軸維度。
styleNamestringThe style name; a blank value removes the attribute. / 樣式名稱;空白值會移除屬性。
SetAxisTitle(string, string?)
Sets the title of the axis for the specified dimension. 設定指定維度座標軸的標題。
public void SetAxisTitle(string dimension, string? title)
Parameters
dimensionstringThe axis dimension, e.g. x, y, or z. / 座標軸維度,例如 x、y 或 z。
titlestringThe axis title; a blank value removes the existing title. / 座標軸標題;空白值會移除既有標題。
SetBubbleSeries(IEnumerable<OdfBubbleChartSeriesRequest>)
Replaces the current series with one or more bubble chart series. 以一組或多組泡泡圖序列取代目前圖表序列。
public void SetBubbleSeries(IEnumerable<OdfBubbleChartSeriesRequest> series)
Parameters
seriesIEnumerable<OdfBubbleChartSeriesRequest>The bubble chart series requests. / 泡泡圖序列要求。
Exceptions
SetCategories(string)
Sets the cell range address of the X-axis category labels. 設定 X 軸分類標籤的儲存格範圍位址。
public void SetCategories(string cellRangeAddress)
Parameters
cellRangeAddressstringThe cell range address of the category labels. / 分類標籤的儲存格範圍位址。
SetChartType(OdfChartType)
Sets the chart type. 設定圖表類型。
public void SetChartType(OdfChartType chartType)
Parameters
chartTypeOdfChartTypeThe chart type. / 圖表類型。
SetDataRange(string, OdfCellRange)
Short overload of SetDataRange that accepts sheetName and range; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 sheetName 與 range;其餘可選參數使用預設值並轉呼叫最長 SetDataRange 多載。
public void SetDataRange(string sheetName, OdfCellRange range)
Parameters
sheetNamestringrangeOdfCellRange
SetDataRange(string, OdfCellRange, bool)
Short overload of SetDataRange that accepts sheetName, range, and firstRowAsHeader; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 sheetName、range 與 firstRowAsHeader;其餘可選參數使用預設值並轉呼叫最長 SetDataRange 多載。
public void SetDataRange(string sheetName, OdfCellRange range, bool firstRowAsHeader)
Parameters
sheetNamestringrangeOdfCellRangefirstRowAsHeaderbool
SetDataRange(string, OdfCellRange, bool, bool)
Binds the chart data source to a spreadsheet cell range. 將圖表資料來源綁定至試算表的儲存格範圍。
public void SetDataRange(string sheetName, OdfCellRange range, bool firstRowAsHeader, bool firstColumnAsLabel)
Parameters
sheetNamestringThe sheet name. / 工作表名稱。
rangeOdfCellRangeThe cell range. / 儲存格範圍。
firstRowAsHeaderboolWhether the first row is treated as the series header; defaults to true. / 首列作為序列標題(header),預設 true。
firstColumnAsLabelboolWhether the first column is treated as the category label (X-axis); defaults to true. / 首欄作為分類標籤(X 軸),預設 true。
SetFloorStyleName(string?)
Sets the style name of the 3D chart floor (chart:floor). 設定 3D 圖表地板(chart:floor)的樣式名稱。
public void SetFloorStyleName(string? styleName)
Parameters
styleNamestringThe style name; null or blank removes the chart:floor element. / 樣式名稱;null 或空白會移除 chart:floor 元素。
SetLegend(string)
Sets the legend position. 設定圖例位置。
public void SetLegend(string position)
Parameters
positionstringThe legend position, e.g. top, bottom, start, or end. / 圖例位置,例如 top、bottom、start 或 end。
SetSeriesDataLabelPreset(int, OdfChartDataLabelPreset)
Sets the data label for the specified data series according to a common preset combination. 依常用預設組合設定指定資料序列的數據標籤。
public void SetSeriesDataLabelPreset(int seriesIndex, OdfChartDataLabelPreset preset)
Parameters
seriesIndexintThe zero-based series index. / 序列索引(從 0 起算)。
presetOdfChartDataLabelPresetThe data label preset combination; None removes the existing setting. / 資料標籤預設組合;None 表示移除既有設定。
Exceptions
- ArgumentOutOfRangeException
Thrown when
seriesIndexis out of range. / 當seriesIndex超出範圍時擲出。
SetSeriesDataLabels(int, OdfChartDataLabelInfo?)
Sets the data label for the specified data series. 設定指定資料序列的數據標籤。
public void SetSeriesDataLabels(int seriesIndex, OdfChartDataLabelInfo? info)
Parameters
seriesIndexintThe zero-based series index. / 序列索引(從 0 起算)。
infoOdfChartDataLabelInfoThe data label setting; pass null to remove the existing setting. / 數據標籤設定;傳入 null 表示移除既有設定。
Exceptions
- ArgumentOutOfRangeException
Thrown when
seriesIndexis out of range. / 當seriesIndex超出範圍時擲出。
SetStockGainMarkerStyleName(string?)
Sets the style name of the stock chart gain marker (chart:stock-gain-marker). 設定股票圖上漲標記(chart:stock-gain-marker)的樣式名稱。
public void SetStockGainMarkerStyleName(string? styleName)
Parameters
styleNamestringThe style name; null or blank removes the chart:stock-gain-marker element. / 樣式名稱;null 或空白會移除 chart:stock-gain-marker 元素。
SetStockLossMarkerStyleName(string?)
Sets the style name of the stock chart loss marker (chart:stock-loss-marker). 設定股票圖下跌標記(chart:stock-loss-marker)的樣式名稱。
public void SetStockLossMarkerStyleName(string? styleName)
Parameters
styleNamestringThe style name; null or blank removes the chart:stock-loss-marker element. / 樣式名稱;null 或空白會移除 chart:stock-loss-marker 元素。
SetStockRangeLineStyleName(string?)
Sets the style name of the stock chart range line (chart:stock-range-line). 設定股票圖範圍線(chart:stock-range-line)的樣式名稱。
public void SetStockRangeLineStyleName(string? styleName)
Parameters
styleNamestringThe style name; null or blank removes the chart:stock-range-line element. / 樣式名稱;null 或空白會移除 chart:stock-range-line 元素。
SetStockSeries(IEnumerable<OdfStockChartSeriesRequest>)
Replaces the current series with one or more stock chart series. 以一組或多組股票圖序列取代目前圖表序列。
public void SetStockSeries(IEnumerable<OdfStockChartSeriesRequest> series)
Parameters
seriesIEnumerable<OdfStockChartSeriesRequest>The stock chart series requests. / 股票圖序列要求。
Exceptions
SetWallStyleName(string?)
Sets the style name of the 3D chart wall (chart:wall). 設定 3D 圖表牆面(chart:wall)的樣式名稱。
public void SetWallStyleName(string? styleName)
Parameters
styleNamestringThe style name; null or blank removes the chart:wall element. / 樣式名稱;null 或空白會移除 chart:wall 元素。
TryGetChartStyle(string)
Attempts to get the chart style summary with the specified name. 嘗試取得指定名稱的圖表樣式摘要。
public OdfChartStyleInfo? TryGetChartStyle(string name)
Parameters
namestringThe style name. / 樣式名稱。
Returns
- OdfChartStyleInfo
The chart style summary; null if it does not exist or is not a chart style. / 圖表樣式摘要;若不存在或不是圖表樣式則為 null。