Getting coordinates for points on scatter charts

C

Charlie

Can anyone tell me a way to (programatically) draw lines from the 0,0
point in my scatter chart to a given point in a series?

I can't figure out how to get the X,Y coordinates of a point, and I
definitely can't figure out how to tell the X,Y coordinates where my
zero axes intersect.

Thanks for your help!

-- Charlie
 
J

Jon Peltier

Charlie -

There are ways to determine the coordinates of objects on charts, and I
have posted a small amount of information about that on my web site.

But I'm going to save you needing some Excedrin. Make another small data
range in the worksheet:

0 0
x y

where x,y are the coordinates of the point, based on the data used to
chart the original data. Copy this range, select the chart, and use
Paste Special from the Edit menu to add this data as a new series, by
columns. Double click on one of the new points, and format the series to
have a line and no markers.

This would be easy to embellish. Say you wanted to be able to plot by
point number. Let's say your original data was in A1:B20, and the small
bit of data above was in D1:E2. In F2 enter a number, say 1 for a start.
Enter this formula in D2:

=index(A$1:A$20,$F$2)

This gives you the $F$2'th cell in column A, the X values. Copy this
cell and paste it into E2. Because of the use of $ in the formula, it
changes to:

=index(B$1:B$20,$F$2)

This gives you the corresponding Y value. As you change the value in F2,
the line moves to different points.

You can make it even fancier by adding a scrollbar from the forms menu.
You'll have to get the Forms menu from Toolbars on the View menu. Format
the scrollbar control so its min is 1 and max is 20 (or however many
points there are), and link it to cell F2.

Way better than trying to determine the coordinates to draw a line,
especially if the chart changes size or the axis limits move.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top