+ Reply to Thread
Results 1 to 14 of 14

Automatically re-sizing chart to fit Data and Vertical Catalog Axis

  1. #1
    Registered User
    Join Date
    09-27-2012
    Location
    Canada
    MS-Off Ver
    Excel 2013
    Posts
    62

    Smile Automatically re-sizing chart to fit Data and Vertical Catalog Axis

    I finally got the Dynamic Ranges working and it's almost all GOOD, except two last problems:

    1) My Vertical Category Axis is feed with two Columns: Column 'A' giving the Position number and Column 'B' giving the name of the individual in the position. On the Chart the Position number is entered vertically while the Name is reported Horizontally. How Can I get both Horizontal? I can't stretch the Vertical Category Axis box and I can't find if/where I can change the Box size.

    2) How do I set the height of the chart to adjust with the data so if it's only providing information on five positions as per the picture or 123 positions the graph is legible

    Thanks as always

    Axis_Problem.png

  2. #2
    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,938

    Re: Automatically re-sizing chart to fit Data and Vertical Catalog Axis

    Please upload a sample of your workbook, not a picture of your data. Pictures are pretty much impossible to edit, and no-one wants to re-type your data for you
    Also, not all members can upload picture files (Company firewalls and stuff) - and, depending on what browser is being used, some pics dont even show up on the forum

    Your workbook should show a small desensitized example of the data you are working with and a manual mockup of the expected results.
    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

  3. #3
    Registered User
    Join Date
    09-27-2012
    Location
    Canada
    MS-Off Ver
    Excel 2013
    Posts
    62

    Re: Automatically re-sizing chart to fit Data and Vertical Catalog Axis

    Please see attached
    Demo_Human_Resources_Salary_Burn_Template.xlsm

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

    Re: Automatically re-sizing chart to fit Data and Vertical Catalog Axis

    If you uncheck the "multi-level category axis" box (format category axis dialog), it will combine the two into a single, horizontal text string. Is that what you are looking for?
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

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

    Re: Automatically re-sizing chart to fit Data and Vertical Catalog Axis

    As for 2), is there a specific part you are having trouble with -- the "automatically" part or the "change height" part.

    For the "change height" part, it seems like it should be as simple as choosing a suitable value for the .height property of the chartobject object: https://msdn.microsoft.com/en-us/lib.../ff193576.aspx

    For the "automatically" part, I would expect it to be something associated with a change or calculate event.

  6. #6
    Registered User
    Join Date
    09-27-2012
    Location
    Canada
    MS-Off Ver
    Excel 2013
    Posts
    62

    Re: Automatically re-sizing chart to fit Data and Vertical Catalog Axis

    Thanks for your reply MrShort.

    Where should I be finding the "multi-level category axis" box (format category axis dialog), in excel 2013? I have the format Axis Box open on the Right hand side, but I'm not seeing anything??

    As far as the height issue, I don't care how thick the lines are exacly, I'm just trying to figure out a way that I can use the Pivot table to select different filters which will in turn produce a Chart that is legible every time. I added a demo about 4 posts up if you want to take a look.

    Thanks for all your time.

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

    Re: Automatically re-sizing chart to fit Data and Vertical Catalog Axis

    Unfortunately, 2007 is as high as my knowledge goes. You might pull up the help files in your Excel installation to see if they can help you find this checkbox. I have put out a request to someone with 2013 to look at this and comment.

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

    Re: Automatically re-sizing chart to fit Data and Vertical Catalog Axis

    As far as the height issue, I don't care how thick the lines are exacly, I'm just trying to figure out a way that I can use the Pivot table to select different filters which will in turn produce a Chart that is legible every time. I added a demo about 4 posts up if you want to take a look.
    Perhaps I am not understanding what you are asking here, and I did see your demo. In your demo, in the immediate window if the VBE, I entered activesheet.chartobjects(1).height=1000 (with sheet5 active), and the chart got bigger. So, it seems to me that the chartobject.height property can be used to vary the vertical size of the chart. From there, I would expect a trial and error process to figure out what value to put into the height property for a given number of categories.

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

    Re: Automatically re-sizing chart to fit Data and Vertical Catalog Axis

    You can only control the alignment of the inner most labels.

    Multi-level category labels option is within the Labels section of the Format axis task pane
    Cheers
    Andy
    www.andypope.info

  10. #10
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Automatically re-sizing chart to fit Data and Vertical Catalog Axis

    What happens if you select the vertical axis?
    I clicked it, selected the names and set the alignment to vertical
    I attached your workbook. I got an error because I'm missing the calendar component but that's beside the pint.
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

  11. #11
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Automatically re-sizing chart to fit Data and Vertical Catalog Axis

    And have you tested? You could at least have the decency to answer or say thank you if it works.

  12. #12
    Registered User
    Join Date
    09-27-2012
    Location
    Canada
    MS-Off Ver
    Excel 2013
    Posts
    62

    Re: Automatically re-sizing chart to fit Data and Vertical Catalog Axis

    Sorry I did not read the last three replies Friday.

    I got the Vertical Axis problem solved by creating a third Dynamic Range which Concatenated (is that the proper term??) the two Dynamic Ranges. This idea came to me on the drive home.
    Please Login or Register  to view this content.
    I still have not figured out if/how to get the size of the chart to adjust automatically with varying amounts of rows??

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

    Re: Automatically re-sizing chart to fit Data and Vertical Catalog Axis

    Quote Originally Posted by FranktheBank
    I still have not figured out if/how to get the size of the chart to adjust automatically with varying amounts of rows??
    What part of this are you having trouble with?

    1) Counting the number of categories? I would expect a COUNT() or COUNTA() or COUNTIF() function should do this
    2) Determining the desired height that you want to use with that number of categories? This is probably the hardest or most tedious part. I would expect that you will need some "trial and error":
    2a) select pivot criteria that yield a certain number of categories.
    2b) manually adjust height to the desired height for that number of categories
    2c) Use the chartobject.height property to read the height and store it somewhere.
    2d) Go back to 2a and select a different number of categories and repeat 2a to 2c.
    2e) Analyze the heights vs number of categories until you can see a strategy for determining a suitable height for any number of categories.
    3) Applying the desired height value to the chartobject.height property.

    Where do you get stuck?

  14. #14
    Registered User
    Join Date
    09-27-2012
    Location
    Canada
    MS-Off Ver
    Excel 2013
    Posts
    62

    Re: Automatically re-sizing chart to fit Data and Vertical Catalog Axis

    The issue is if a person runs the Pivot Table with no Filters, it can contain 125+ rows, which would be an extremely large graph and the User would have to stretch it down to get all the information. Leaving the risk that the User may not stretch it down enough. If the user runs the Pivot Table with a Filter it could have a little as three rows which would be quite manageable.

    What I am trying to accomplish is to have the size of the graph (the height) automatically grow/shrink pending on the amount of rows in the Pivot Table

+ 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. Space between Vertical Y Axis and chart data
    By ktawni in forum Excel General
    Replies: 2
    Last Post: 12-04-2015, 06:56 PM
  2. [SOLVED] Automatically scale X axis of a chart as new data is added?
    By smaier69 in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 11-09-2015, 01:17 AM
  3. Replies: 2
    Last Post: 01-22-2015, 03:51 PM
  4. Stacked columns chart - use non-numerical data in the vertical axis
    By guillermo_A in forum Excel Charting & Pivots
    Replies: 6
    Last Post: 07-01-2014, 09:35 AM
  5. [SOLVED] How to draw a chart horizontal axis and vertical axis
    By kiany406 in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 09-17-2012, 02:56 PM
  6. Replies: 1
    Last Post: 04-14-2012, 06:05 AM
  7. Chart using one column as vertical axis and others on horizontal axis!!!
    By nandhamnk in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 11-28-2007, 09:40 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