+ Reply to Thread
Results 1 to 8 of 8

Dynamic Histogram - Series Plots OFF Primary Axis? Help

  1. #1
    Forum Contributor
    Join Date
    08-22-2017
    Location
    USA
    MS-Off Ver
    2016 WINDOWS and MAC
    Posts
    294

    Dynamic Histogram - Series Plots OFF Primary Axis? Help

    Hi,

    I have created a macro with a dynamic histogram. Histogram dynamically changes based on which data set the user selects. The histogram includes 2 key features: A vertical line for MEDIAN and a separate for MEAN. The way I do this is with a Scatter Plot with Smooth Line - I only compute the min + max values for the Y-axis, and then the MEAN and MEDIAN are used for the X-axis.

    Problem I am having is that when I dynamically change the data set, the vertical lines are no longer correctly on the PRIMARY axis. However, if i hover my mouse over them, they appear to be correct.

    Please see the attached images. The first image depicts the one data set, where i designed the chart. The next data set is dynamically changed and results in improperly placed vertical lines.

    Thank you!!

    P.S. would prefer not to post my macro, as i'd like to keep it private.
    Right.PNG

    Wrong.PNG

    Chart Types.PNG

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

    Re: Dynamic Histogram - Series Plots OFF Primary Axis? Help

    Are you updating both the primary and secondary axis with your macro?
    Cheers
    Andy
    www.andypope.info

  3. #3
    Forum Contributor
    Join Date
    08-22-2017
    Location
    USA
    MS-Off Ver
    2016 WINDOWS and MAC
    Posts
    294

    Re: Dynamic Histogram - Series Plots OFF Primary Axis? Help

    Hi, yes the macro updates the primary and secondary axis. I have tried nearly everything from using secondary axis to using non-secondary and still have no luck!

  4. #4
    Forum Contributor
    Join Date
    08-22-2017
    Location
    USA
    MS-Off Ver
    2016 WINDOWS and MAC
    Posts
    294

    Re: Dynamic Histogram - Series Plots OFF Primary Axis? Help


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

    Re: Dynamic Histogram - Series Plots OFF Primary Axis? Help

    You need to create a sample file with enough data and code to illustrate the problem.

  6. #6
    Forum Contributor
    Join Date
    08-22-2017
    Location
    USA
    MS-Off Ver
    2016 WINDOWS and MAC
    Posts
    294

    Re: Dynamic Histogram - Series Plots OFF Primary Axis? Help

    Hi,

    You can download the file here:

    https://www.dropbox.com/s/bro6660ngn...ting.xlsm?dl=0



    Please let me know what you find. Im quite convinced this issue is not solveable.

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

    Re: Dynamic Histogram - Series Plots OFF Primary Axis? Help

    You need to recalculate the x values and they are not plotting as true x points.

    All series are now on the primary axis. The middle of each column goes 1, 2, 3 etc. even though the category label suggests otherwise.

    Range M24:N28 contains the new X values for the vertical lines.
    The freq curve also needs new X values, in range F16:F29, in order to be positioned in center of column.
    Attached Files Attached Files

  8. #8
    Forum Contributor
    Join Date
    08-22-2017
    Location
    USA
    MS-Off Ver
    2016 WINDOWS and MAC
    Posts
    294

    Re: Dynamic Histogram - Series Plots OFF Primary Axis? Help

    So basically you just created an x-axis with a normal scale of 1,2,3... OK confusing, but I follow what you did. I honestly had a similar idea but I just couldnt quite put it down on paper (or spreadsheet in this case)... Thanks for the help. I greatly appreciate it!!

+ 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. Matching Secondary axis to Primary in dynamic chart
    By rpena4 in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 10-12-2016, 02:28 PM
  2. [SOLVED] Series is using wrong X-axis values in dynamic chart
    By jerbes in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 03-31-2015, 12:21 PM
  3. Replies: 2
    Last Post: 10-08-2014, 08:04 PM
  4. Replies: 1
    Last Post: 10-08-2014, 06:36 PM
  5. Select primary and secondary axis series with checkbox for chart
    By amandaca in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-20-2011, 08:31 AM
  6. Primary/Secondary Axis series count
    By raydenl in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 07-28-2005, 04: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