+ Reply to Thread
Results 1 to 6 of 6

How to add vertical line to existing chart?

Hybrid View

  1. #1
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,468

    Re: How to add vertical line to existing chart?

    I'm not sure what you tried. Here's what I did:

    1) I will need a dummy point/series for the current price. In E2, I enter =D2. In F2 I enter a value. I choose 120000 (something near the maximum).
    2) Add a new data series to the chart. In the Select data dialog, add a new data series using F2 for the values.
    3) Exit the select data dialog, select the new data series, and change the chart type of this series to "XY scatter".
    4) If Excel does not automatically add the secondary vertical and horizontal axes, format the new series to be on the secondary axis system and add both secondary axes.
    5) Back to the select data dialog and edit the new series so that it is use E2 for the X values.
    6) Format the secondary horizontal axis so that its min is 424.5 and its max is 449.5. This should make the two horizontal axes about the same, so that the horizontal position of the new series data point is between the 430 and 431 columns.
    7) Select the new series and add error bars. Delete the horizontal error bars. Format the vertical error bars to show only the negative error bar and set it to have a length of 100%.
    8) Format the secondary vertical axis so that it has the same limits as the primary vertical axis.
    9) Format the error bar and the data series to have the appearance you want.
    10) Any other formatting you want to apply.

    That should work for the specific example given. If I were to expand this to make it more flexible so that it would be easy to use for different data series, I would work out a different relationship between the secondary horizontal axis max and min and the value in E2. I would explore different combinations of values for the value in F2 and the secondary vertical axis max and min. I would need to know if I always expected the "strike prices" to always be very integer, or if it would be possible for these to be more scattered. And so on. But the basic idea would remain throughout all of those variations. Add an additional XY scatter data series to the chart with an error bar, and figure out the combination of axis limits and E2,F2 values that position the vertical line correctly.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  2. #2
    Registered User
    Join Date
    06-14-2023
    Location
    Austin, tX
    MS-Off Ver
    2016
    Posts
    6

    Re: How to add vertical line to existing chart?

    I appreciate the reply, another gentleman helped me out and I was able to get it to work by changing the chart type to xy scatter. Unless I misunderstood what you are saying, but is there any easy way to get it to work with column chart or make the scattered chart look like column chart? The problem I see is that excel doesn't know to use those horizontal labels as x axis to place the vertical line for the colum chart. Thanks.

+ 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. Interactive vertical line on line chart
    By SammyDC in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 01-06-2022, 08:28 AM
  2. [SOLVED] Vertical line in a histogram (vertical bar chart)
    By AdamCPTD in forum Excel General
    Replies: 2
    Last Post: 11-18-2017, 03:04 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 chart
    By joedrummer in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 08-23-2008, 07:26 AM
  6. vertical line chart
    By Larissa in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 03-03-2006, 12:10 AM
  7. [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