+ Reply to Thread
Results 1 to 9 of 9

Trying to set chart axis by actual data it is sorting through

  1. #1
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Houston, TX
    MS-Off Ver
    office 365
    Posts
    639

    Trying to set chart axis by actual data it is sorting through

    Since I tried using the MIN & MAX but that does not seem to work since it returns zero for the axis even though it the values start at 10000. Is there a way to have the axis format based on the actual data it is sorting.

    Ex : range is 10867 thru 19766

    How can I get the range to format with MIN @ 10867 and max @ 19766

    The data comes form Column C

    Please help.

  2. #2
    Forum Contributor noboffinme's Avatar
    Join Date
    08-29-2013
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2003/7/10/13/16/19
    Posts
    1,071

    Re: Trying to set chart axis by actual data it is sorting through

    Hi,

    It always helps to post the file you're working on to help explain your issue.

    Can you post the file?
    Remember you are unique, like everyone else

  3. #3
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Houston, TX
    MS-Off Ver
    office 365
    Posts
    639

    Re: Trying to set chart axis by actual data it is sorting through

    Please Login or Register  to view this content.

  4. #4
    Forum Contributor noboffinme's Avatar
    Join Date
    08-29-2013
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2003/7/10/13/16/19
    Posts
    1,071

    Re: Trying to set chart axis by actual data it is sorting through

    That helps, but can you also post the data file that the code applies to?

  5. #5
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Houston, TX
    MS-Off Ver
    office 365
    Posts
    639

    Re: Trying to set chart axis by actual data it is sorting through

    The file is huge I deleted alot of the data files usually my Rows are over 250,000

    Thanks

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

    Re: Trying to set chart axis by actual data it is sorting through

    It would seem to me that all you need to do is replace this:
    Please Login or Register  to view this content.
    with something other than scaleisauto=true. You can use the .minimumscale and .maximumscale properties to set the minimum and maximum values to whatever you deem appropriate http://msdn.microsoft.com/en-us/libr...ice.15%29.aspx
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  7. #7
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Houston, TX
    MS-Off Ver
    office 365
    Posts
    639

    Re: Trying to set chart axis by actual data it is sorting through

    I realize you can manually set it, I want it to automatically grab the range on the data it is using. I am sorting through 600,000 rows of data I don't know the range with out looking through the entire file that is why I would like the chart to do it when it creates itself.

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

    Re: Trying to set chart axis by actual data it is sorting through

    You can adapt something like this.

    Please Login or Register  to view this content.
    if you need to do more that 1 series, store the result of min and then compare to holding variable, updating as necessary. Then use that value to set scale minimum
    Cheers
    Andy
    www.andypope.info

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

    Re: Trying to set chart axis by actual data it is sorting through

    Which is another way of saying that you don't like Excel's default algorithm for choosing axis limits and would like a different algorithm. Excel only knows the one algorithm, so, when you want something different, you have to write your own algorithm and apply it using the .minimumscale and .maximum scale properties.

    You found the last row and stored it in the lLR variable and used it to set the ranges for the data series. You can do something very similiar using the MIN and MAX functions in VBA (http://msdn.microsoft.com/en-us/libr...ice.15%29.aspx even uses the Min function in its example). Somewhere before you format the axis, you will need to use the Min and Max functions to find the minimum and maximum values of the desired range. Then you can apply those values to the minimumscale and maximumscale properties.

+ 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] Two Y Axis's One X, Chart Data not in sync with X axis between Y axis's
    By MJSlattery in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 12-08-2013, 12:08 AM
  2. [SOLVED] Chart with X Axis Showing Actual Passage of Time
    By pcook911 in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 08-02-2013, 01:12 AM
  3. Excel chart. Displaying y axis numbers different to actual plot values.
    By Richard Buttrey in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-12-2011, 12:40 PM
  4. Sorting chart X axis based on yearly Quarters
    By Raisedwell in forum Excel General
    Replies: 5
    Last Post: 03-04-2010, 10:56 PM
  5. chart scale from actual Y axis data
    By robert111 in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 03-12-2008, 09:41 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