problem with drawing vertical line on chart

B

barbetta3141

I'm using Peltier's
http://peltiertech.com/Excel/Charts/AddLineVertSeries.html
to draw a vertical dotted line on a time series chart (to "split" the
chart at the current date). But I can't get the vertical line in the
right place. I think it's setup correctly:

Today
5/21/2006 0
5/21/2006 1

I think the problem is the secondary axis scale. Excel thinks it's a
number series instead of a date series. Any help on how to tell Excel
it's also a date series, or any other ideas on how to get the line in
the right place? Thanks.
 
D

David Biddulph

I'm using Peltier's
http://peltiertech.com/Excel/Charts/AddLineVertSeries.html
to draw a vertical dotted line on a time series chart (to "split" the
chart at the current date). But I can't get the vertical line in the
right place. I think it's setup correctly:

Today
5/21/2006 0
5/21/2006 1

I think the problem is the secondary axis scale. Excel thinks it's a
number series instead of a date series. Any help on how to tell Excel
it's also a date series, or any other ideas on how to get the line in
the right place? Thanks.

Have you tried Format Axis/ Number tab/ set as date (& then, if necessary,
go to scale tab & set min & max to sensible dates, remembering that you can
put data in as dates, but when you read the values they will appear as
numbers).
 
J

Jon Peltier

Here's a trick that didn't make the web page. After Excel gives you the
secondary axes go to Options on the Chart men. On the Axes tab uncheck the
secondary X axis box. If the chart is suddenly distorted with some points
squashed off to the left and the vertical line is off to the right, it means
the line series is using a category axis, not a time scale axis. Either
change the axis to a time scale axis (Chart menu > Options > Axes tab,
Primary X Axis, choose Time Scale, not Category or Automatic), or use a
number for the X value for the vertical line. Count the points to the left
of where the line should go and add 0.5. For example, if the line goes
between the 6th and 7th points, use this:

6.5 0
6.5 0

- Jon
 

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