Adding a Vertical line : Some problems

  • Thread starter Thread starter Shekar K Rao
  • Start date Start date
S

Shekar K Rao

Hi

I am having a problem while adding more than one vertical line to one of my
graphs. This is because the data I am tracking is on a monthly basis, while
the tutorial(link:
http://peltiertech.com/Excel/Charts/AddLineVertSeries.html) explains how to
add a vertical line only if the X axis is on a daily basis. Is there any
workaround for this?

For example, here is my sample data:
1 Jan 05 : 6
1 Feb 05 : 3
1 Mar 05 : 4
1 Apr 05 : 4
1 May 05 : 3
1 Jun 05 : 4
and so on...until 1 Dec 05, plotted as a column chart, with dates on the X
Axis.

Now, let's say I want to add vertical lines at 4 points in the year : 1 Mar
05, 1 Jun 05, 1 Sep 05 and 1 Nov 05. I found I could do so, but the monthly
columns now become single lines, and the whole X axis goes for a toss!

Any ideas on how to solve this problem? TIA ;)!

Cheers,
Shekar.
 
Shekar -

What has happened is that your chart's time scale axis went from a base unit of
months to a base unit of days, when you added the series for the vertical lines. The
columns are now each less than a day wide, thin enough to look like vertical lines.

The easiest fix is to convert the axis to a category axis. Choose Chart Options from
the Chart menu, and on the Axis tab, change the Category X Axis option from Auto or
Time Scale to Category.

For the X values of the vertical lines, you can no longer use the date. You have to
use a value that tells which category it will be located at. If you want your line
for 1 March to coincide with the column chart data point at March 1 (i.e., bisect
it), use 3 for its X value. If you want the line to fall between the Feb 1 and March
1 columns, use 2.5 instead.

Now construct the vertical lines following the instructions in my web page.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______
 
Back
Top