Is there a way to draw a vertical line from a point on the chart line to the bottom of the chart

G

greg

If you build a line chart connected to a bunch of x/y values
Is there a way to draw a vertical line from a point on the chart line to the
bottom of the chart?

Do you need to layer another chart on top?
Can you add the vertical line right on the same chart?

thanks for any help
 
J

Joel

I don't have access to my code that does this. It is at work and I'm not
planning to be back in my office for at least a week.

My code found the the chart area (left, top, width height) in pixels. I
then scaled the x-axis to find the point where to drop the line,

If your x-axis goes from 200 to 300 and you want to drop a line at 225 then

the x pixel is the following

left + [(225 - 200)/(300-200)]*width

Your Y length of the line you have to rememer to multiply by -1. The sceen
pixels start at (0,0) which is the upper left corner of the window. Positive
x dimension goes from left to right. Positive Y direction goes from top of
the screen to bottom of the screen. The graph (0,0) is in the bottom left
corner of the screen. So the height of the graph is in the opposite
direction from the pixel coordinates.

Good luck. I have a macro that drops 3 lines on each graph where the time
scale of the x-axis is different for each graph. I even made each vertical
line a different color. I had excel automatically generate the graph and
then changed the dimensions of the x-axis using a macro. Finally after the
graph was scaled to to my requirements I dropped the 3 lines a specific
locations.
 
J

JLGWhiz

Did you know that there is a Charting news group that you can post this
question in?
 
M

marcus

Hi Greg

This may be overly simplistic but I thought to put lines vertically
from the points on your line chart to the floor of the chart you do
the following.

Highlight the line in your Line chart - Right click - Format Data
Series - Options - Drop Lines

Hope this helps.

Marcus
 
G

greg

I am looking at this y error bars.
can you have different colored error lines? or are you stuck with one color
for all error lines?
thanks
 

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