+ Reply to Thread
Results 1 to 4 of 4

Excel 2007 : How to draw a horizontal line on a Chart?

  1. #1
    Registered User
    Join Date
    12-05-2011
    Location
    Cincinnati, OH
    MS-Off Ver
    Excel 2007
    Posts
    40

    Unhappy How to draw a horizontal line on a Chart?

    Hello folks,

    Sigh... I would like to draw a horizontal line across a graph, with the Y=axis value coming from a cell (so it can be altered).

    I have spent hours and hours looking at threads about this, and doing what they say to, but nothing really works.

    The basic method I have been following is to "create a defined name" "with a reference to ={1,1}<sheet+cellreference>" then in the graph create a new data set "=SERIES(,,<definedname>,1)"

    This ALMOST works, except I get a line drawn from X-axis "1 to 2" not across the entire graph.

    I would greatly appreciate any help I can get!

    - Thomas

  2. #2
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: How to draw a horizontal line on a Chart?

    Hi and welcome to the board

    This site will provide answers

  3. #3
    Registered User
    Join Date
    12-05-2011
    Location
    Cincinnati, OH
    MS-Off Ver
    Excel 2007
    Posts
    40

    Re: How to draw a horizontal line on a Chart?

    Quote Originally Posted by arthurbr View Post
    Hi and welcome to the board

    This site will provide answers
    Hi Arthur,

    Well, that site provides a different method, but it does not allow the user to change a single cell value to alter the line placement. The graph I am drawing is of a sensor measurement over time, and we want to allow the user to enter a High Alarm and Low Alarm value to cause corresponding horizontal lines.

    I guess I could "fake it" by having the user defined value duplicated into a 2 point array for drawing the line, but eventually we'll be moving to a graph with multiple Y axis, and then the method you linked to would no longer be available (if I understand it correctly).

    So, back to the original question, does anyone know a way to draw a horizontal line across a chart, using the single cell value to provide the y-axis value?

    The basic method I have been following is to "create a defined name" "with a reference to ={1,1}<sheet+cellreference>" then in the graph create a new data set "=SERIES(,,<definedname>,1)"

    This ALMOST works, except I get a line drawn from X-axis "1 to 2" not across the entire graph.

    I would greatly appreciate any help I can get!

    - Thomas
    Last edited by ThomasHaller; 12-05-2011 at 04:25 PM. Reason: typos

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

    Re: How to draw a horizontal line on a Chart?

    You can draw line in the following ways.

    Series of repeated data points
    XY scatter with 2 data points for start and finish
    XY scatter with 1 data point and X-error bar

    You can use formula to repeat single user entry to populate multiple data points.
    Cheers
    Andy
    www.andypope.info

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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