Vertical line on Excel chart

S

septimus

I have a bar chart in Excel. I want to add a series of vertical dotted
lines at certain points on the x axis.

I can do this manually using Insert -> Shapes -> Line, but I want to
do it programatically.

I am able to put dotted vertical BARS (not lines) at the desired
points. And I can put a dotted line that runs across the bottom at
zero and then goes up at tne desired point, but neither are really
acceptable solutions.

There must be a way to do this?

Thanks!
 
M

Martin Brown

I have a bar chart in Excel. I want to add a series of vertical dotted
lines at certain points on the x axis.

I can do this manually using Insert -> Shapes -> Line, but I want to
do it programatically.

In XL2003 or earlier macro capture should work enough to allow you to
see what you would have to do. Versions after that all bets are off.
I am able to put dotted vertical BARS (not lines) at the desired
points. And I can put a dotted line that runs across the bottom at
zero and then goes up at tne desired point, but neither are really
acceptable solutions.

There must be a way to do this?

If you mean to do as cursors at specific scaled points on a graph then
it is possible programatically but you have to provide separate versions
for XL2003 and earlier and XL2007 and above.

Getting the lines to sit exactly where you want is amusing as there are
plenty of quirks if the y graph scale gets switched to log for instance.
 
S

septimus

I'm using Excel 2007. Recording a macro doesn't seem helpful; it
catches when I copy a line but not when or where I paste it.
What I'd really like is to create a data series of vertical dotted
lines. Is that possible??

Thanks!
 
M

Martin Brown

I'm using Excel 2007. Recording a macro doesn't seem helpful; it

Macro recorder in XL2007 is extremely unhelpful and seriously broken.
catches when I copy a line but not when or where I paste it.
What I'd really like is to create a data series of vertical dotted
lines. Is that possible??

Thanks!

It is possible. I have used a similar method to allow users to put
integration limit cursors on a graph of data. But I can't see why you
would want to plot a whole data series that way. Custom graph paper?
 
S

septimus

My client wants to visually break the chart into sections to make the
chart more readable. There would be a vertical dotted line at the
beginning of each section.

So how is it possible? What would you do to accomplish this?
 

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