+ Reply to Thread
Results 1 to 13 of 13

Auto-populate/generate scatter plot from selection in e.g. drop down lists

  1. #1
    Registered User
    Join Date
    04-01-2015
    Location
    Sweden
    MS-Off Ver
    2013
    Posts
    10

    Auto-populate/generate scatter plot from selection in e.g. drop down lists

    Hi,

    I've attached a file as example.

    The low-down is that I want users to be able to,

    1) Open "Data"-sheet, and paste variable-data for multiple persons in columns U-AY.
    2) Open "Results"-sheet, and select either one or a multiple set of "Factors" from "Data"-sheet (columns C-T), via e.g. drop-down lists, which then would automatically populate a scatter plot in the "Results"-sheet (based on the selection of Factors).

    Any ideas? Or would it be simpler to just pre-make separate graphs for every possible combination and fetch these based on the drop-down selections (please no...)?

    Thanks for your input!
    Attached Files Attached Files

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,919

    Re: Auto-populate/generate scatter plot from selection in e.g. drop down lists

    What is it you are trying to plot? Can you give a sample chart? Also can you explain better how the selection of the factors affect the plot.

    Can the selected factors be non-contiguous?
    Last edited by dflak; 04-21-2016 at 11:43 AM.
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  3. #3
    Registered User
    Join Date
    04-01-2015
    Location
    Sweden
    MS-Off Ver
    2013
    Posts
    10

    Re: Auto-populate/generate scatter plot from selection in e.g. drop down lists

    Thanks for your reply. I updated the Example.xls (attached) with sample graphs: 2 for factor-combinations, 1 for single-factor. I'm unsure what you mean by non-contiguos, but the factors should be possible to mix and match: like Factor 1 and 13, 5 and 8, etc.
    Attached Files Attached Files
    Last edited by RHEDE; 04-22-2016 at 09:31 AM. Reason: Now with graphs!

  4. #4
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,919

    Re: Auto-populate/generate scatter plot from selection in e.g. drop down lists

    I do not see any charts in this download.

  5. #5
    Registered User
    Join Date
    04-01-2015
    Location
    Sweden
    MS-Off Ver
    2013
    Posts
    10

    Re: Auto-populate/generate scatter plot from selection in e.g. drop down lists

    Sigh Fixed it, thanks.

    R

  6. #6
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,919

    Re: Auto-populate/generate scatter plot from selection in e.g. drop down lists

    Much better

  7. #7
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,919

    Re: Auto-populate/generate scatter plot from selection in e.g. drop down lists

    I have some more questions based on the examples.

    I can see when you have just one factor selected you get a plot with a "generic" 1, 2, 3, 4 on the X-axis.

    If you select 2 factors you plot one on the X-axis and one on the Y-axis. Do you have any rules as to which gets plotted on the X-Axis and which gets plotted on the Y-Axis?

    What do you want to do if you select more than two factors?

  8. #8
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,919

    Re: Auto-populate/generate scatter plot from selection in e.g. drop down lists

    I think I have what you want.

    Cells B2 and B3 on the Chart Sheet let you pick the Y and X Axis. "None" is an option for the X-Axis if you only want to plot one thing.

    The key to the plot are the dynamic ranges defined with the name manager. I had to include some VB code. When you change what you want to plot on the Y-axis, you loose the labels. I have a change event on the chart page to trigger code to restore them. I am plotting 4 points in each range. If more points are required, or if a variable number of points are required then the named ranges will have to be made more dynamic.

    The following two articles explain how I built the named ranges and applied them to the charts.
    http://www.utteraccess.com/wiki/inde...Dynamic_Ranges
    http://www.utteraccess.com/wiki/inde...namic_Charting
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    04-01-2015
    Location
    Sweden
    MS-Off Ver
    2013
    Posts
    10

    Re: Auto-populate/generate scatter plot from selection in e.g. drop down lists

    That is simply outstanding. Thank you dflak. As to your earlier question about what goes on which axis, the X-axis should be the primary-plotted-axis (I changed this in the file you provided, no problems).

    1) I do however need to be able to plot a variable amount of data points. Do you have an easy-peasy solutions for this? I'm not asking out of pure laziness (only partly ), I usually learn better when the correct solution is already in place - allowing me to pick it apart.
    2) If Plot-None is selected (i.e. omitting a factor for the Y-axis) how would one remove or make the Y-axis-scale transparent? I'm guessing more vba, which is really out of my league. Is it easily doable, like the label-redeeming-code you provided?

    Thanks again, your help is so appreciated.

    R
    Last edited by RHEDE; 04-27-2016 at 05:45 AM. Reason: Also, thanks for the utteraccess-links. Very useful!

  10. #10
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,919

    Re: Auto-populate/generate scatter plot from selection in e.g. drop down lists

    I'm going on holiday. I'll take a look at it when I get back next week .

  11. #11
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,919

    Re: Auto-populate/generate scatter plot from selection in e.g. drop down lists

    I added a bit of code to the change event on the chart sheet.
    Please Login or Register  to view this content.
    This code checks to see if there is a change in cell B2 or B3 and then runs the appropriate subroutine to either add labels or change the axis.

    In the apply labels module I added a new subroutine
    Please Login or Register  to view this content.
    I didn't "invent" this code. I just recorded a macro to add and delete the axis and cleaned it up a bit. The macro recorder often does not produce very good code but it does help a lot with syntax and how to address things like the X axis.
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    04-01-2015
    Location
    Sweden
    MS-Off Ver
    2013
    Posts
    10

    Re: Auto-populate/generate scatter plot from selection in e.g. drop down lists

    I hope your holiday was nice dflak.

    Obviously you didn't "invent" it, however you helped me and invented the idea about how to approach this problem. Equally good in my opinion. So, thank you. Any pointers on how to approach the plotting of a variable amount of data points? I.e. if I'd want more than AA, BB, CC, DD. Like AA-ZZ.

  13. #13
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,919

    Re: Auto-populate/generate scatter plot from selection in e.g. drop down lists

    To extend the range you would have to modify the definitions of X_Plot and Y_Plot

    =IF(Chart!$B$3="None",Plot_None,OFFSET(Data!$A$1,1,MATCH(Chart!$B$3,Data!$A$1:$T$1,0)-1,4,1))
    =OFFSET(Data!$A$1,1,MATCH(Chart!$B$2,Data!$A$1:$T$1,0)-1,4,1)

    Change the 4 to match the number of rows.

    You might also have to play with the definition of Plot_None =Lookups!$E$2:$E$5

+ 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. [SOLVED] Auto-populate fields based on drop down selection
    By kwo in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-23-2015, 07:15 AM
  2. Auto Populate cells based on Drop-down selection
    By stepzuko in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-11-2014, 03:02 PM
  3. drop down selection to auto populate multiple cells
    By chika90 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-03-2013, 10:08 AM
  4. Auto-populate field based on drop down box selection
    By nicfarrell in forum Excel General
    Replies: 7
    Last Post: 01-21-2013, 12:47 AM
  5. Using IF comman to generate scatter plot
    By ganges in forum Excel Charting & Pivots
    Replies: 5
    Last Post: 08-14-2012, 08:51 AM
  6. Drop Down Lists - how to auto-populate with first few letters typed?
    By stemcell1 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-28-2008, 10:31 AM
  7. [SOLVED] Auto populate several cells based on a selection from drop down li
    By Sheldon in forum Excel General
    Replies: 3
    Last Post: 01-13-2006, 04:30 PM

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