+ Reply to Thread
Results 1 to 4 of 4

Column chart with vertical line

  1. #1
    Registered User
    Join Date
    08-04-2015
    Location
    CO
    MS-Off Ver
    2013
    Posts
    13

    Column chart with vertical line

    I am trying to make a column chart that has a vertical line so the viewer can quickly see how much of the data is to the left and right and how far away the data is from it. The image below demonstrates what I am going for. I added the red line for effect in Paint.

    Kc2FBs3.png

    I am able to make the blue columns no problem. However when I attempt to add the vertical line, the result always ends up as the following. Note how the vertical line does not get placed where I want it: the 95 mark on the x-axis; which is clearly within the data range. Instead the data gets clumped together to the left and the vertical line flung to the right.

    yWpLttj.png

    I have read around to find what to do, but pretty much only got results saying to do what I thought I would have to do, which I did:

    1. Highlight the points representing the endpoints of the vertical line (A15:B16).
    2. Select the chart and use Paste Special...
    3. Make sure to choose the option to add cells as a new series, y-values in columns, and x-labels in first column in the popup dialog.
    4. Right click on the new series and choose "Change Series Chart Type..." from the context menu.
    5. Choose the XY Scatter plot with markers. (Keep markers for easier selection)
    6. Right click on the data series and choose "Format Data Series..." from the context menu.
    7. Select the option to plot the series on the primary axis, set markers to none, and make the line a little thinner.
    8. Inspect plot to see it is not as expected.

    Please advise.

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,829

    Re: Column chart with vertical line

    You need to recognize that a column chart uses a category X axis, not a value axis. So, when the XY scatter is laid on top of the column chart, the categories for the column chart will correspond to the X values 1, 2, 3, etc. You will need to figure out what value to put in A15 and A16 so that the line is between category 3 and category 4. You can probably work out an interpolative formula, but I expect the value for A15 and A16 will be close to 3.8.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

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

    Re: Column chart with vertical line

    See attached where x position is calculated via TREND formula.
    Attached Files Attached Files
    Cheers
    Andy
    www.andypope.info

  4. #4
    Registered User
    Join Date
    08-04-2015
    Location
    CO
    MS-Off Ver
    2013
    Posts
    13

    Re: Column chart with vertical line

    Thanks, MrShorty, for explaining what is going on under the hood. It really helped me understand what is going wrong.

    Thanks, Andy Pope, for providing an example using an Excel formula. I can write an interpolation formula, but it helps to have something already implemented.

+ 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. Vertical line in a histogram (vertical bar chart)
    By AdamCPTD in forum Excel General
    Replies: 2
    Last Post: 11-18-2017, 03:04 AM
  2. Replies: 2
    Last Post: 09-03-2013, 09:18 AM
  3. [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
  4. How to create a vertical reference line on a time series line chart
    By Bladebgii in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 05-23-2012, 10:17 AM
  5. Vertical Line in Column Chart
    By Beginner Level in forum Excel General
    Replies: 7
    Last Post: 03-15-2012, 02:12 AM
  6. Vertical Line Chart?
    By BlueDaze in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 03-30-2007, 03:30 PM
  7. 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
  8. [SOLVED] [SOLVED] How to add a vertical line to a Line Chart that aleady has 2 Y axi
    By ISUTUBBS in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 10-28-2005, 12:05 AM

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