PowerPoint) (Chart.GetChartElement 方法

會傳回指定之 X 座標及 Y 座標上圖表項目的詳細資訊。

語法

expression。 GetChartElement( _x_, _y_, _ElementID_, _Arg1_, _Arg2_ )

expression 代表 Chart 物件的變數。

參數

名稱 必要/選用 資料類型 描述
x 必要 長整數 圖表項目的 X 座標。
y 必要 長整數 圖表項目的 Y 座標。
ElementID 必要 長整數 此方法傳回時,此引數會包含指定之座標上圖表項目的 XlChartItem 值。 如需詳細資訊,請參閱<註解>一節。
Arg1 必要 長整數 方法傳回時,此引數會包含與圖表項目相關的資訊。 如需詳細資訊,請參閱<備註>一節。
Arg2 必要 長整數 方法傳回時,此引數會包含與圖表項目相關的資訊。 如需詳細資訊,請參閱<備註>一節。

註解

若您僅指定前兩個引數的值,一般並不常使用此方法。 Microsoft Word 會填入其他的引數,而您的程式碼必須檢查方法傳回的這些值。

方法傳回座標值後,無論 Arg1 及 Arg2 是否含有任何資訊,ElementID 的值都會顯示在下列表格中。

ElementID 常數 **常數值** Arg1 Arg2
xlAxis 21 AxisIndex AxisType
xlAxisTitle 17 AxisIndex AxisType
xlDisplayUnitLabel 30 AxisIndex AxisType
xlMajorGridlines 15 AxisIndex AxisType
xlMinorGridlines 16 AxisIndex AxisType
xlPivotChartDropZone 32 DropZoneType 無
xlPivotChartFieldButton 31 DropZoneType 無
xlDownBars 20 GroupIndex 無
xlDropLines 26 GroupIndex None
xlHiLoLines 25 GroupIndex 無
xlRadarAxisLabels 27 GroupIndex 無
xlSeriesLines 22 GroupIndex 無
xlUpBars 18 GroupIndex 無
xlChartArea 2 無 無
xlChartTitle 4 無 無
xlCorners 6 無 無
xlDataTable 7 無 無
xlFloor 23 無 無
xlLeaderLines 29 無 無
xlLegend 24 無 無
xl無 28 無 無
xlPlotArea 19 無 無
xlWalls 5 無 無
xlDataLabel 7 SeriesIndex PointIndex
xlErrorBars 9 SeriesIndex 無
xlLegendEntry 12 SeriesIndex 無
xlLegendKey 13 SeriesIndex 無
xlSeries 3 SeriesIndex PointIndex
xlShape 14 ShapeIndex 無
xlTrendline 8 SeriesIndex TrendLineIndex
xlXErrorBars 10 SeriesIndex 無
xlYErrorBars 11 SeriesIndex 無

下列表格說明方法傳回座標值後 Arg1 及 Arg2 的意義。

引數 說明
AxisIndex 指定座標軸主要或次要。 可以是下列其中一個 XlAxisGroup 常數: xlPrimary 或 xlSecondary 。
AxisType 會指定座標軸類型。 可以是下列其中一個 XlAxisType 常數: xlcategory 做 、 xlSeriesAxis 或 xlValue 。
DropZoneType 會指定放置區域類型: 資料行、 資料、 頁面或列欄位。 可以是下列 XlPivotFieldOrientation 常數之一: xlColumnField 、 xlDataField 、 xlPageField 或 xlRowField 。 欄和列欄位常數分別指定數列] 和 [類別] 欄位。
GroupIndex 指定特定圖表群組在 ChartGroups 集合內的位移。
PointIndex 指定數列中特定點的 Points 集合內的位移。 值為 1 時,表示已選取所有資料點。
SeriesIndex 指定特定數列在 Series 集合內的位移。
ShapeIndex 指定特定圖案在 Shapes 集合內的位移。
TrendlineIndex 指定數列中特定趨勢線在 Trendlines 集合內的位移。

另請參閱

Chart 物件

支援和意見反應

有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應。