Chart.GetChartElement Method
Returns information about the chart element at the specified x-coordinate and y-coordinate.
Namespace: Microsoft.Office.Interop.PowerPoint
Assembly: Microsoft.Office.Interop.PowerPoint (in Microsoft.Office.Interop.PowerPoint.dll)
Syntax
'Declaration
Sub GetChartElement ( _
X As Integer, _
Y As Integer, _
<OutAttribute> ByRef ElementID As Integer, _
<OutAttribute> ByRef Arg1 As Integer, _
<OutAttribute> ByRef Arg2 As Integer _
)
'Usage
Dim instance As Chart
Dim X As Integer
Dim Y As Integer
Dim ElementID As Integer
Dim Arg1 As Integer
Dim Arg2 As Integer
instance.GetChartElement(X, Y, ElementID, _
Arg1, Arg2)
void GetChartElement(
int X,
int Y,
out int ElementID,
out int Arg1,
out int Arg2
)
Parameters
- X
Type: System.Int32
The x-coordinate of the chart element.
- Y
Type: System.Int32
The y-coordinate of the chart element.
- ElementID
Type: System.Int32
When the method returns, this argument contains the XlChartItem value of the chart element at the specified coordinates. For more information, see the Remarks section.
- Arg1
Type: System.Int32
When the method returns, this argument contains information related to the chart element. For more information, see the Remarks section.
- Arg2
Type: System.Int32
When the method returns, this argument contains information related to the chart element. For more information, see the Remarks section.
Remarks
This method is unusual in that you specify values for only the first two arguments. Microsoft PowerPoint fills in the other arguments, and your code should examine those values when the method returns.
The value of ElementID after the method returns determines whether Arg1 and Arg2 contain any information, as shown in the following table.
ElementID Constant |
Constant Value |
Arg1 |
Arg2 |
---|---|---|---|
21 |
AxisIndex |
AxisType |
|
17 |
AxisIndex |
AxisType |
|
30 |
AxisIndex |
AxisType |
|
15 |
AxisIndex |
AxisType |
|
16 |
AxisIndex |
AxisType |
|
32 |
DropZoneType |
None |
|
31 |
DropZoneType |
None |
|
20 |
GroupIndex |
None |
|
26 |
GroupIndex |
None |
|
25 |
GroupIndex |
None |
|
27 |
GroupIndex |
None |
|
22 |
GroupIndex |
None |
|
18 |
GroupIndex |
None |
|
2 |
GroupIndex |
None |
|
4 |
GroupIndex |
None |
|
6 |
GroupIndex |
None |
|
7 |
None |
None |
|
23 |
None |
None |
|
29 |
None |
None |
|
24 |
None |
None |
|
28 |
None |
None |
|
19 |
None |
None |
|
5 |
None |
None |
|
7 |
SeriesIndex |
PointIndex |
|
9 |
SeriesIndex |
None |
|
12 |
SeriesIndex |
None |
|
13 |
SeriesIndex |
None |
|
3 |
SeriesIndex |
PointIndex |
|
14 |
SeriesIndex |
None |
|
8 |
SeriesIndex |
TrendLineIndex |
|
10 |
SeriesIndex |
None |
|
11 |
SeriesIndex |
None |
The following table describes the meaning of Arg1 and Arg2 after the method returns.
Argument |
Description |
---|---|
AxisIndex |
Specifies whether the axis is primary or secondary. Can be one of the following XlAxisGroup constants: xlPrimary or xlSecondary. |
AxisType |
Specifies the axis type. Can be one of the following XlAxisType constants: xlCategory, xlSeriesAxis, or xlValue. |
DropZoneType |
Specifies the drop zone type: column, data, page, or row field. Can be one of the following XlPivotFieldOrientation constants: xlColumnField, xlDataField, xlPageField, or xlRowField. The column and row field constants specify the series and category fields, respectively. |
GroupIndex |
Specifies the offset within the ChartGroups collection for a specific chart group. |
PointIndex |
Specifies the offset within the Points collection for a specific point within a series. A value of –1 indicates that all data points are selected. |
SeriesIndex |
Specifies the offset within the Series collection for a specific series. |
ShapeIndex |
Specifies the offset within the Shapes collection for a specific shape. |
TrendlineIndex |
Specifies the offset within the Trendlines collection for a specific trendline within a series. |