GET.CHART.ITEM macro

Returns the vertical or horizontal position of a point on a chart item. Use these position numbers with FORMAT.MOVE and FORMAT.SIZE to change the position and size of chart items. Position is measured in points; a point is 1/72nd of an inch.

Syntax

GET.CHART.ITEM(x_y_index, point_index, item_text)

X_y_index    is a number specifying which of the coordinates you want returned.

X_y_index Coordinate returned
1 Horizontal coordinate
2 Vertical coordinate

Point_index    is a number specifying the point on the chart item. These indexes are described below. If point_index is omitted, it is assumed to be 1.

Point_index Chart item position
1 Lower or left
2 Upper or right

 

Point_index Chart item position
1 Upper left
2 Upper middle
3 Upper right
4 Right middle
5 Lower right
6 Lower middle
7 Lower left
8 Left middle

 

Point_index Chart item position
1 Arrow shaft
2 Arrowhead

 

Point_index Chart item position
1 Outermost counterclockwise point
2 Outer center point
3 Outermost clockwise point
4 Midpoint of the most clockwise radius
5 Center point
6 Midpoint of the most counterclockwise radius

Item_text    is a selection code that specifies which item of a chart to select. See the chart form of SELECT for the item_text codes to use for each item of a chart.

 

Remarks

If the specified item does not exist, or if a chart is not active when the function is carried out, the #VALUE! error value is returned.

Examples

The following macro formulas return the horizontal and vertical locations, respectively, of the top of the main-chart value axis:

GET.CHART.ITEM(1, 2, "Axis 1")

GET.CHART.ITEM(2, 2, "Axis 1")

You could then use FORMAT.MOVE to move a floating text item to the position returned by these two formulas.

Related Functions

GET.DOCUMENT   Returns information about a workbook

GET.FORMULA   Returns the contents of a cell

Return to index