+ Reply to Thread
Results 1 to 10 of 10

Create or add chart data source buttons outside of chart

  1. #1
    Registered User
    Join Date
    08-26-2021
    Location
    Collierville, Tenessee
    MS-Off Ver
    365
    Posts
    4

    Create or add chart data source buttons outside of chart

    Hello everyone,

    Is it possible to have the active/inactive check box of a Chart's "data source" outside of the chart?
    (*see red circle in attached image)

    We have several models to test, and each model requires 10-20 tests. I was thinking of making 1 spreadsheet per model. To not clutter the chart with too much information I would like the active/inactive buttons beside each data chart to quickly display or hide said information, and not have to open the "Select Data Source" box each time.
    I would then make a new spreadsheet for each model we test.

    See attached sample excel with 2 data charts.

    Thanks,
    David T
    Attached Images Attached Images
    Attached Files Attached Files

  2. #2
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: Create or add chart data source buttons outside of chart

    Hi there,

    See if the attached version of your workbook gets you moving in the right direction.

    Entering a non-blank value (e.g. X) in any of the yellow cells will cause the values in the associated data column to be displayed in the lower set of data values. The charts take their values from the lower set of data values, so individual graphs will appear/disappear as appropriate.

    Hope this helps - please let me know how you get on.

    Regards,

    Greg M
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    08-26-2021
    Location
    Collierville, Tenessee
    MS-Off Ver
    365
    Posts
    4

    Re: Create or add chart data source buttons outside of chart

    Thank you Greg, I assume it's not possible to link buttons to the data source inside the chart (red circle in image at beginning of thread)?
    If that's not possible, the file you uploaded will do just what I need after some small tweaks.

    On another note, is there a way to add a "scale" beside the y or x axis that wouldn't require stacking charts or adding images manually?
    I would like to display 2 units, the secondary unit would be dynamically linked to the first (the attached image is made with photo editing just to visualize). The primary unit is GPM "gallons per minute" and the secondary LPS "liters per second"

    Many thanks,
    David TAttachment 745645

  4. #4
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: Create or add chart data source buttons outside of chart

    Hi again David,

    Thanks for your feedback.

    The attached workbook includes (on the chart) buttons which toggle the visible/hidden states of the individual graphs. They are all located at the top of the chart rather than at the end of each graph (which would be significantly more difficult to achieve.)


    On another note, is there a way to add a "scale" beside the y or x axis that wouldn't require stacking charts or adding images manually?
    I would like to display 2 units, the secondary unit would be dynamically linked to the first (the attached image is made with photo editing just to visualize). The primary unit is GPM "gallons per minute" and the secondary LPS "liters per second"

    As far as I know (which don't necessarily make it so! ), although you can have a secondary Y-axis, it's not possible to have a secondary X-Axis, so I've provided a cell which you can use to select either "Gallons" or "Litres", and the scale and legend of the X-Axis will update appropriately. (I'm happy to be corrected by anyone who knows that a secondary X-Axis can be provided )

    Hope this helps - as before, please let me know how you get on.

    Regards,

    Greg M
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    08-26-2021
    Location
    Collierville, Tenessee
    MS-Off Ver
    365
    Posts
    4

    Re: Create or add chart data source buttons outside of chart

    Thank you Greg!

    The buttons are exactly what I need.

    On the second topic, what if it is not an axis but a dynamic shape/line? Not sure what to call it but it would have the same length as the x axis and it would convert from GPM to LPS and adjust the tick marks accordingly.

    Best Regards,

    David T

  6. #6
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: Create or add chart data source buttons outside of chart

    Hi again David,

    Thanks for your feedback - glad to hear that the buttons are doing what you need.

    As far as the second point is concerned, I think that trying to create a "do-it-yourself" adjustable X-axis complete with tickmarks, and values would be quite a complicated undertaking

    I'm quite happy to be corrected/educated by someone who's managed to achieve something like this

    Regards,

    Greg M

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

    Re: Create or add chart data source buttons outside of chart

    You can enable a secondary X axis and set the labels to Low, so they appear under the primary axis labels
    You will need to modify the formula so it does not do the refactoring of the x axis values

    EDIT: You can also add some event code to swap the vertical gridlines.
    This goes in the Sheet object

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by Andy Pope; 08-28-2021 at 04:56 AM.
    Cheers
    Andy
    www.andypope.info

  8. #8
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: Create or add chart data source buttons outside of chart


    I'm quite happy to be corrected/educated by someone who's managed to achieve something like this


    Thanks, Andy!

    Regards,

    Greg M

  9. #9
    Registered User
    Join Date
    08-26-2021
    Location
    Collierville, Tenessee
    MS-Off Ver
    365
    Posts
    4

    Re: Create or add chart data source buttons outside of chart

    Thank you Greg and Andy, with this I can run a much more efficient analysis.

    Best Regards,
    David T

  10. #10
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: Create or add chart data source buttons outside of chart

    Hi again David,

    Many thanks for your feedback.

    You're welcome - glad I was able to help.

    Regards,

    Greg M

+ 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. Using Next/Back buttons to change Chart data source
    By ambadatexcel in forum Excel General
    Replies: 2
    Last Post: 09-19-2017, 11:24 AM
  2. [SOLVED] Radio Buttons to Toggle Chart Source Data
    By gophins in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-25-2015, 11:39 AM
  3. Chart not updated until chart sheet opened following source data update
    By untilyesterday in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 09-24-2013, 12:27 PM
  4. Create chart with variables data source
    By vietnam in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-30-2012, 04:08 AM
  5. Create chart with variables data source
    By vietnam in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-29-2012, 10:21 PM
  6. [SOLVED] Toggle Buttons to change data source in single chart
    By eface2face in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-23-2012, 03:45 PM
  7. Replies: 4
    Last Post: 07-13-2009, 08:27 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