Drawing a Line between two points
Author Message
Drawing a Line between two points

....Help....I would appreaciate it if someone could point me in the right
direction to solve the following problem:

I want to add some code to an XL macro which will draw a line between to
data points on a chart object.  Assume that I have the x and y coordinates
in cells x1, x2 and y1, y2 respectively (same metric as the x and y axis).

I want to create a line object which can then be copied and pasted as I
construct the desired form on the chart based on the length defined above.
The Line object requires its arguments in points relative to the upper left
corner of the chart object.  Is there a way to convert the user x,y metric
into coordinates relative to the upper left of the chart?  Will it be
insensitive to various monitor resolution changes? Will it be insensitive to
stand alone vs embedded charts?

Wed, 18 Jun 1902 08:00:00 GMT
Drawing a Line between two points
If youi have x1,x2,y1,y2 points, then just adding these as a new series of
xy-scatter chart should make it be a connected line.

Quote:

>....Help....I would appreaciate it if someone could point me in the right
>direction to solve the following problem:

>I want to add some code to an XL macro which will draw a line between to
>data points on a chart object.  Assume that I have the x and y coordinates
>in cells x1, x2 and y1, y2 respectively (same metric as the x and y axis).

>I want to create a line object which can then be copied and pasted as I
>construct the desired form on the chart based on the length defined above.
>The Line object requires its arguments in points relative to the upper left
>corner of the chart object.  Is there a way to convert the user x,y metric
>into coordinates relative to the upper left of the chart?  Will it be
>insensitive to various monitor resolution changes? Will it be insensitive
to
>stand alone vs embedded charts?

Wed, 18 Jun 1902 08:00:00 GMT
Drawing a Line between two points
Bob...Thanks, but for the application, I need a straight line of a specific
length so I can "construct" a more complicated diagram with a series of
pastes.  Using a series of "Series"commands won't work the way I need it to
work.

Any other ideas?.......Rob

Quote:

>If youi have x1,x2,y1,y2 points, then just adding these as a new series of
>xy-scatter chart should make it be a connected line.

>>....Help....I would appreaciate it if someone could point me in the right
>>direction to solve the following problem:

>>I want to add some code to an XL macro which will draw a line between to
>>data points on a chart object.  Assume that I have the x and y coordinates
>>in cells x1, x2 and y1, y2 respectively (same metric as the x and y axis).

>>I want to create a line object which can then be copied and pasted as I
>>construct the desired form on the chart based on the length defined above.
>>The Line object requires its arguments in points relative to the upper
left
>>corner of the chart object.  Is there a way to convert the user x,y metric
>>into coordinates relative to the upper left of the chart?  Will it be
>>insensitive to various monitor resolution changes? Will it be insensitive
>to
>>stand alone vs embedded charts?

Wed, 18 Jun 1902 08:00:00 GMT
Drawing a Line between two points
Hi Rob,

Quote:
> I need a straight line of a specific
> length so I can "construct" a more complicated diagram with a series of
> pastes.  Using a series of "Series" commands won't work the way I need it
to
> work.

PMFJI

You can extend Bob's suggestion (which was the answer to your question - your
question just wasn't really your question).  You can draw pretty much any
picture/shape you want using XY lines.  For example, a diamond in a square
may be the coordinates (one series):

X      Y
10     10
10     50
50     50
50     10
10     10

30     10
10     30
30     50
50     30
30     10

Note that by missing a blank, the XY line has a gap.

Regards

Stephen Bullen
Microsoft MVP - Excel
http://www.BMSLtd.co.uk

Wed, 18 Jun 1902 08:00:00 GMT

 Page 1 of 1 [ 4 post ]

Relevant Pages