+ Reply to Thread
Results 1 to 3 of 3

Matching Secondary axis to Primary in dynamic chart

  1. #1
    Registered User
    Join Date
    10-12-2016
    Location
    Hartford, CT
    MS-Off Ver
    2013
    Posts
    2

    Matching Secondary axis to Primary in dynamic chart

    Hello,
    My challenge is that I have a stacked column chart, with an average trend line on the secondary axis. The chart is dynamic and controlled via slicers. Whenever a different slicer option is selected, the chart changes and updates with the corresponding data. This means that the scale for both axis changes independently based on the underlying data. However, I need the secondary axis to match the primary. For example, item #1 has a max value of 10 on the primary axis, and 5 on the secondary axis, while item #2 has a max value of 50 on the primary and 15 on the secondary. For item #1 I'd like both axis to show 10 and for item #2 for both to show 50. Simply changing the max value for the secondary axis does not work since when a different slicer selection is made, the axis won't change.

    I'm at a loss here so any help would be greatly appreciated. Thanks in advance.

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

    Re: Matching Secondary axis to Primary in dynamic chart

    A couple of ideas:

    idea 1: There is this tutorial about building a "proportional" secondary axis (http://peltiertech.com/secondary-axe...tional-scales/ ) that should work very well. The main complication I see is that is appears that this is in a pivot table, which has additional limitations. This essay (http://peltiertech.com/regular-chart...-pivot-tables/ ) discusses those limitations and how to work around them. Combining the principles on those two pages, one should be able to create a chart like you describe with good, proportional axis (where it sounds like you want the proportion to be 1).

    idea 2: You could use VBA (probably in a change or calculate event) to adjust the secondary axis parameters as needed. This tutorial (http://peltiertech.com/link-excel-ch...lues-in-cells/ ) describes a procedure that reads axis parameters from the spreadsheet and writes them to the axis. The main adjustment in your case is reading the axis parameters from the primary axis and writing them to the secondary axis.

    Not single click commands by any means, but, if you study these pages and follow Jon's examples carefully, you should be able to see how to develop one of those ideas into something you can use. Let us know where you get stuck and we'll help as best we can.
    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
    10-12-2016
    Location
    Hartford, CT
    MS-Off Ver
    2013
    Posts
    2

    Re: Matching Secondary axis to Primary in dynamic chart

    These are great options... I'll be sure to study up on both and see what works best.

    Thanks again!

+ 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. Clustered column chart (primary and secondary axis)
    By ziad9933 in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 08-30-2014, 05:22 AM
  2. matching labels of secondary with primary axis
    By furor in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 07-08-2011, 08:04 AM
  3. Excel chart: Aligning secondary axis with primary
    By Harlort in forum Excel General
    Replies: 3
    Last Post: 04-04-2011, 10:26 AM
  4. Replies: 15
    Last Post: 07-26-2010, 04:35 AM
  5. Replies: 1
    Last Post: 05-03-2006, 09:20 PM
  6. Replies: 2
    Last Post: 05-03-2006, 09:20 PM
  7. Replies: 2
    Last Post: 05-03-2006, 09:20 PM

Tags for this Thread

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