+ Reply to Thread
Results 1 to 3 of 3

Add lines (arrows preferred) between related series of XY scatter

  1. #1
    Valued Forum Contributor AlvaroSiza's Avatar
    Join Date
    09-19-2007
    Location
    Staffordshire
    MS-Off Ver
    2007
    Posts
    591

    Add lines (arrows preferred) between related series of XY scatter

    Simple XY Scatter:

    x-axis represents nth instance of home sale (From intersect of y-axis out to right; Sale No. 1, Sale No. 2, etc.)
    y-axis represents Sale Price

    For each x there are two y values - Sale Price and Adjusted Sale Price.

    I would like to connect, hopefully via directional arrow, the sale price and adjusted sale price showing the direction of adjustment. (Downward arrow if Adjusted Sales Price is below the actual Sales Price, upward arrow if Adjusted Sales Price is above the actual Sales Price.

    Here is a screenshot of what I'm after. The 1st and 2nd instance of x is how it appears now, with all others how I would like them to appear bearing in mind that red can and will often be below white.

    XY w lines.png

    Quoting Andy Pope from http://www.pcreview.co.uk/forums/con...-t3687181.html
    If the chart is really a xy-scatter then Hi-Low lines are not available. You can mimic the lines using Custom Error bars. You need to calculate the difference between each pair of Y values and use them as the Custom Error value.
    How specifically do I implement custom error bars to accomplish what I am after? I have calculated the spread between each instance of y values.

    Many thanks!

    AS
    Last edited by AlvaroSiza; 10-13-2012 at 03:27 PM. Reason: Additional Detail
    Perhaps it was the Noid who should have avoided me...
    If you are satisfied with my solution click the small star icon on the left. Thanks
    1. Make a copy of your workbook and run the following code on your copy (just in case)
    2. With excel open, press ALT+F11 to open the Visual Basic Editor (VBE). From the "Insert" menu, select "Module".
    3. Paste the code from above into the empty white space. Close the VBE.
    4. From the developer tab, choose "Macros", select the Sub Name, and click "Run".

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

    Re: Add lines (arrows preferred) between related series of XY scatter

    With your regular X axis spacing you could use a line chart and therefore use the drop lines.

    If you use the xy-scatter you add error bars and then on the format error bars dialog use the Custom button to select the range of cells to use.

    Alternatively you could use a xy series to draw the arrow line.
    Attached Files Attached Files
    Cheers
    Andy
    www.andypope.info

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

    Re: Add lines (arrows preferred) between related series of XY scatter

    Edit:
    Ignore the suggestion of Line chart and drop lines. This will not work as the lines always drop down.

+ 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