ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Vertical line on Excel chart (https://www.excelbanter.com/excel-programming/446061-vertical-line-excel-chart.html)

septimus

Vertical line on Excel chart
 
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!

Martin Brown

Vertical line on Excel chart
 
On 15/05/2012 20:02, septimus wrote:
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.

--
Regards,
Martin Brown

septimus

Vertical line on Excel chart
 
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!


On May 15, 4:49*pm, Martin Brown
wrote:
On 15/05/2012 20:02, septimus wrote:

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.

--
Regards,
Martin Brown



Martin Brown

Vertical line on Excel chart
 
On 16/05/2012 20:21, septimus wrote:
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?

On May 15, 4:49 pm, Martin
wrote:
On 15/05/2012 20:02, septimus wrote:

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.



--
Regards,
Martin Brown

septimus

Vertical line on Excel chart
 
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?


On May 17, 7:38*am, Martin Brown
wrote:
On 16/05/2012 20:21, septimus wrote:

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?









On May 15, 4:49 pm, Martin
wrote:
On 15/05/2012 20:02, septimus wrote:


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.


--
Regards,
Martin Brown




All times are GMT +1. The time now is 08:50 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com