+ Reply to Thread
Results 1 to 11 of 11

Dynamic y axis on graphs

  1. #1
    Forum Contributor
    Join Date
    06-13-2008
    Location
    London, England
    MS-Off Ver
    2010
    Posts
    277

    Dynamic y axis on graphs

    Hi Guys,

    I am pulling a series of data to place into graphs.

    I need these graphs to have the same y axis max value as each other, however the data varies so i need this to change when i change the input data.

    I cannot use the excel Auto function as this will change the y axis to diferent values for each chart when they need to all show the same value.

    I cannot set them as a fixed value because when I change the input data this value may be too high or low.

    Any ideas on a solution?
    Last edited by freud1; 04-23-2009 at 08:47 AM.

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

    Re: Dynamic y axis on graphs

    The scales have 2 options auto or fixed.
    You need to determine the fixed value for all the scales and then apply that to each chart via code.

    Or if the auto option for the chart with the largest values is acceptable you can add a dummy series to each chart that plots that data, thus forcing all the charts to use the same auto values.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Forum Contributor
    Join Date
    06-13-2008
    Location
    London, England
    MS-Off Ver
    2010
    Posts
    277

    Re: Dynamic y axis on graphs

    thanks for getting back to me andy, i dont quite undserstand what you mean.

    I have 5 charts in total that I want to use the same scale, but these charts are populated by the data in the table which changes (from customer to customer)

    for example, if it is graphing income, one customer may be spending aprox £10 per week, so i would want the scale at about 12 for all 5 charts, the next customer may spend £1000 per week so i would need the charts all at £1200.

    the values on each chart may be weekday spend for one chart, and then weekend spend on another, weekend spend would be much lower but i would still like the chart to show the same scale as the weekday spend

    hope this helps.

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

    Re: Dynamic y axis on graphs

    which bit did you not understand?

    Either use a VBA solution to fix all charts to a specific value, based on the data in all charts.

    Or add a dummy series to each chart. This series would contain the values of the chart that has the largest value.

    Can you create a 2 chart example to illustrate your problem?

  5. #5
    Forum Contributor
    Join Date
    06-13-2008
    Location
    London, England
    MS-Off Ver
    2010
    Posts
    277

    Re: Dynamic y axis on graphs

    thanks Andy,

    here is an example sheet.

    ideally i need the Max and Min demand charts to use the max demand scale.

    and i need the average, max consumption and min consumption to use the scale of the Max Demand devided by 2.....


    sorry to make it more complicated
    Attached Files Attached Files

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

    Re: Dynamic y axis on graphs

    To the min chart I added a series that is a duplicate of the Max series. And set the fill to none.

    I did the same for the average charts.
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    06-13-2008
    Location
    London, England
    MS-Off Ver
    2010
    Posts
    277

    Re: Dynamic y axis on graphs

    this is exactly what I wanted!

    never thought about using hidden series!

    Many Many Many thanks!!

  8. #8
    Registered User
    Join Date
    01-29-2012
    Location
    Jamshedpur, India
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Dynamic y axis on graphs

    [QUOTE=freud1;2080801]thanks Andy,
    That's fine .
    But, How to ensure Y axis Max as the maximum cell value of a range?

  9. #9
    Registered User
    Join Date
    11-19-2012
    Location
    Nottingham
    MS-Off Ver
    Excel 2010
    Posts
    1

    Re: Dynamic y axis on graphs

    this is genius! I would never have thought of having an invisible range,thanks guys - another problem solved!

  10. #10
    Registered User
    Join Date
    07-27-2015
    Location
    Burlington, Ontario, Canada
    MS-Off Ver
    2013
    Posts
    1

    Re: Dynamic y axis on graphs

    Hi Andy,

    Thanks, but how I can make the y-axis to begin not from zero but from something else: for different clients I have not necessarily y-range to begin with "O" - thanks.

  11. #11
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: Dynamic y axis on graphs

    Yuriy, welcome to the forum

    Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ 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