Chart.GetChartElement(Int32, Int32, Int32, Int32, Int32) 方法

定义

返回有关指定 X 和 Y 坐标处的图表元素的信息。 本方法的与众不同之处在于只需指定前两个参数的值。 Microsoft Word 会为其余参数赋值,代码应在方法返回时检查这些值。

public:
 void GetChartElement(int x, int y, [Runtime::InteropServices::Out] int % ElementID, [Runtime::InteropServices::Out] int % Arg1, [Runtime::InteropServices::Out] int % Arg2);
public void GetChartElement (int x, int y, out int ElementID, out int Arg1, out int Arg2);
abstract member GetChartElement : int * int * int * int * int -> unit
Public Sub GetChartElement (x As Integer, y As Integer, ByRef ElementID As Integer, ByRef Arg1 As Integer, ByRef Arg2 As Integer)

参数

x
Int32

必需 整数 图表元素的 X 坐标。

y
Int32

必需 整数 图表元素的 Y 坐标。

ElementID
Int32

整数 当 方法返回时,此参数包含 XlChartItem 指定坐标处的图表元素的值。 有关详细信息,请参阅“备注”部分。

Arg1
Int32

整数 当 方法返回时,此参数包含与图表元素相关的信息。 有关详细信息,请参阅“备注”部分。

Arg2
Int32

整数 当 方法返回时,此参数包含与图表元素相关的信息。 有关详细信息,请参阅“备注”部分。

注解

方法返回后的值ElementID确定 和 Arg2 是否Arg1包含任何信息,如下表所示。

xlAxis 21AxisIndexAxisType
xlAxisTitle 17 AxisIndexAxisType
xlDisplayUnitLabel 30AxisIndexAxisType
xlMajorGridlines 15AxisIndexAxisType
xlMinorGridlines 16AxisIndexAxisType
xlPivotChartDropZone 32DropZoneTypeNone
xlPivotChartFieldButton 31DropZoneTypeNone
xlDownBars 20GroupIndexNone
xlDropLines 26GroupIndexNone
xlHiLoLines 25GroupIndexNone
xlRadarAxisLabels 27GroupIndexNone
xlSeriesLines 22GroupIndexNone
xlUpBars 18 GroupIndex
xlChartArea 2
xlChartTitle 4
xlCorners 6
xlDataTable 7
xlFloor 23
xlLeaderLines 29
xlLegend 24
xlNothing 28
xlPlotArea 19
xlWalls 5
xlDataLabel 7 SeriesIndexPointIndex
xlErrorBars 9 SeriesIndexNone
xlLegendEntry 12 SeriesIndexNone
xlLegendKey 13SeriesIndex
xlSeries 3SeriesIndexPointIndex
xlShape 14ShapeIndexNone
xlTrendline 8 SeriesIndexTrendLineIndex
xlXErrorBars 10SeriesIndexNone
xlYErrorBars 11SeriesIndexNone

下表描述了 和 Arg2 在方法返回后的含义Arg1

AxisIndex指定轴主要或辅助。 可以是以下 XlAxisGroup 常量之一: xlPrimaryxlSecondary
AxisType指定坐标轴类型。 可以是以下 XlAxisType 常量之一: xlCategoryxlSeriesAxisxlValue
DropZoneType指定拖放区域类型: 列、 数据、 页或行字段。 可以是以下 XlPivotFieldOrientation 常量之一: xlColumnFieldxlDataFieldxlPageFieldxlRowField。 列和行字段常量分别指定系列和分类字段。
GroupIndex指定集合中 ChartGroups 特定图表组的偏移量。
PointIndex指定集合中序列中 Points 特定点的偏移量。 值 – 1 表示已选择所有数据点。
SeriesIndex指定集合中 Series 特定序列的偏移量。
ShapeIndex指定集合中特定形状的 Shapes 偏移量。
TrendlineIndex指定序列中特定趋势线集合 Trendlines 中的偏移量。

适用于