+ Reply to Thread
Results 1 to 5 of 5

Issue with adding vertical line to stacked column

  1. #1
    Registered User
    Join Date
    03-12-2014
    Location
    Chesapeake, VA
    MS-Off Ver
    Excel 2010
    Posts
    2

    Issue with adding vertical line to stacked column

    I've attached the file. My goal was to add a vertical line (retirement year) to the stacked columns to provide a visual aid to better distinguish working years from retirement years. I was successful at adding the vertical line. BUT...for some reason it stays at the first year and will not move to the right.

    I added a line graph on the seconday axis with (X,Y) values of (2044,0) and (2044,1). It even shows that when I hover over the points on the chart. However, the line is angles instead of straight and it is not centered on 2044 - it's center on 2014.

    Help please!!

    Thanks,
    Brian
    Attached Files Attached Files

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: Issue with adding vertical line to stacked column

    To get a vertical line you need to use xy-scatter rather than line chart type.

    As your horizontal axis is category rather than date you need to use an index value for the x position rather than the year.
    Attached Files Attached Files
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    03-12-2014
    Location
    Chesapeake, VA
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Issue with adding vertical line to stacked column

    Thanks Andy, makes sense. I got the line to work, the only problem for me now is even though I am telling the height of the line to be (in this case) $35,000 it is stopping at $30,000. I want the line to go all the way up to the highest Y value, which it looks like I'm telling it to do. I'm telling it to use points(31,$0) and (31,$35,000).

    Any thoughts on this? See attached. Thanks again!
    Attached Files Attached Files

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: Issue with adding vertical line to stacked column

    Your data series was on the secondary axis. It does not need to be.

    If you do want it on the secondary axis then you need to add secondary vertical axis and set the min/max values to prevent auto scaling reducing the actual height of the line

  5. #5
    Registered User
    Join Date
    06-27-2013
    Location
    Oklahoma City, OK
    MS-Off Ver
    Excel 2010
    Posts
    47

    Re: Issue with adding vertical line to stacked column

    I am not a expert, but wanted to give another suggestion...
    Andy's way is the #1 way to do this, for sure!

    But, if you are just going to keep a vertical line on the chart that goes from the top of the plot area to the bottom of the plot area, you can add a shape line to the graph. I do this on many graphs instead of having to change the data to fit within the plot each time. Then the line can just be dragged to the location you want it in each time you update the graph.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] How to add a vertical line graph on a stacked horizontal bar chart?
    By Why123 in forum Excel Charting & Pivots
    Replies: 6
    Last Post: 08-14-2015, 07:20 PM
  2. [SOLVED] Display vertical line on stacked line chart already using primary and secondary axises
    By ben_hensel in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 09-05-2012, 10:21 AM
  3. Replies: 2
    Last Post: 05-16-2010, 11:23 PM
  4. Adding line to a stacked bar chart
    By ritz in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 04-12-2007, 03:57 AM
  5. Adding a vertical line to a column chart
    By Bill Goszinski in forum Excel General
    Replies: 1
    Last Post: 07-28-2006, 07:55 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1