+ Reply to Thread
Results 1 to 7 of 7

3 variables with y-axis (years)

  1. #1
    Registered User
    Join Date
    02-11-2015
    Location
    Singapore
    MS-Off Ver
    Ms Office 2007
    Posts
    3

    3 variables with y-axis (years)

    Hi! Could I possibly plot the highlighted yellow line on a y-axis?

    Maintaining that the % points should intercept (on the same line) with the values on the yellow line

    Therefore:
    X-axis => Years
    Y-axis 1 => % values
    Y axis 2 => Yellow line


    Screen Shot 2021-09-28 at 1.07.14 AM.png
    Attached Images Attached Images

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

    Re: 3 variables with y-axis (years)

    Excel charts can show a lot of different things. What you want may be possible, but I did not understand what you want the yellow lines to do, so I can't help. Can you explain in more detail what you are trying to achieve?
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    Registered User
    Join Date
    02-11-2015
    Location
    Singapore
    MS-Off Ver
    Ms Office 2007
    Posts
    3

    Re: 3 variables with y-axis (years)

    Hi there! Thanks for replying!

    I am trying to do a chart like I sketched out (with points on both y-axis corresponding and the x-axis being the time (years going by)

    The excel data set is here (where i've been trying to do it unsuccessfully)Excel data.xlsx

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

    Re: 3 variables with y-axis (years)

    I'm still not sure I understand. What I see in your current charts:

    1) You have a stacked area chart that is using columns B and C together as a multi-level category x axis with a single set of Y values to plot against those X values. If I understand, what you want is to have column B be the horizontal category axis labels and columns C and D to be two separate sets of Y values plotted against the X categories. One of the columns should plot on the primary Y axis and the other should plot on the secondary Y axis. Does that sound right? If that is what you want, I would expect to pull up the select data dialog, change the category axis values for the chart to be column B, add another data series to be column C. Then, exit the select data dialog and select one of the data series and format the series so it is plotted on the secondary axis.

    2) You also have an XY scatter chart that is showing column B on the X axis and column C on the primary Y axis and column D on the secondary Y axis. This is what I understand you want, so I am not sure what should be different on this chart.

  5. #5
    Registered User
    Join Date
    02-11-2015
    Location
    Singapore
    MS-Off Ver
    Ms Office 2007
    Posts
    3

    Re: 3 variables with y-axis (years)

    Hi there! Thank you so much again;

    Yes for 2) I have plotted the points but actually I wanted the values on both Y-axis to intersect (I was wondering if this is possible?)

    i.e. 2.0% to meet 50 and 5.0% to meet 100. I was wondering if this could be done with scaling?

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

    Re: 3 variables with y-axis (years)

    If I understand, yes, you can set up the chart's axes to have this kind of scaling. Most of the question is how much do you want it automated.

    First, I will observe that an axis where 2% corresponds to 50 (100% full scale would correspond to 2500) and 5% corresponds to 100 (100% full scale corresponds to 2000) is not as simple as one would assume at first glance. Most of the time, the expectation is that the relationship between the primary and secondary axes is relatively simple (a simple proportion for example secondary=k*primary). The example you give appears to be more complicated, but that is mostly about understanding the relationship between the two axes, which is not important in understanding the programming options.

    Easiest is to simply do it manually. Select an axis -> Format axis -> change the min, max, major unit, minor unit values to get the desired axis range and tick mark spacing.

    If you need a higher level of automation, then you can follow this tutorial here to link these chart axes formatting values to spreadsheet cells: https://peltiertech.com/chart-udf-control-axis-scale/ From there, it's just a matter of figuring out what formulas to enter into the cells.

    An alternative approach, that may be particularly pertinent for something with uneven spacing of the tick marks (like your example numbers suggest) would be to "fake" the secondary axis with a dummy series like described here: https://peltiertech.com/secondary-ax...tional-scales/

    At this point, it is mostly about deciding how you want to interact with the chart/spreadsheet and how much automation you want and exactly what the desired relationship should be between the two axes. Look over the tutorials and see what you want to do.

  7. #7
    Registered User
    Join Date
    06-17-2020
    Location
    Bangkok, Thailand
    MS-Off Ver
    365
    Posts
    17

    Re: 3 variables with y-axis (years)

    This picture is what I tried to interpret from you explanation and data.
    It make me very confuse. What is this data represent for?
    Is this close to your expectation?
    Attached Images Attached Images

+ 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. How to overlay graphs with different years in x axis
    By Avator in forum Excel General
    Replies: 9
    Last Post: 09-25-2017, 03:49 AM
  2. [SOLVED] Stacked bar with Z axis for years
    By kev_ in forum Excel Charting & Pivots
    Replies: 10
    Last Post: 03-12-2017, 04:02 AM
  3. Graphing 2 distinct x axis variables on same Y axis
    By heids in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 03-27-2014, 04:55 AM
  4. [SOLVED] How do I get years to show on x-axis?
    By Carol in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 08-15-2006, 03:15 PM
  5. [SOLVED] I want to display months and years on x axis
    By Michael Drayton in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 04-21-2006, 08:50 AM
  6. Quarterly data with years on the x-axis
    By DE in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 12-22-2005, 07:10 PM
  7. X-axis should read 20,000 years to 0 in intervals of 5,000
    By xm_102 in forum Excel Charting & Pivots
    Replies: 5
    Last Post: 07-14-2005, 01: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