Results 1 to 8 of 8
  1. #1
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Formatting graph area (2000)

    I have plotted the graph below on a sheet on a workbook. What I have found irrtitating is that it automatically scales the x axis and the y axis to fit the shape of the screen. Is there a way I can force it to axis to be, say, 1 inch/ x pixels apart so that they are equal?
    Jerry

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Formatting graph area (2000)

    Tushtar Mehta posted code to make the units equal in this newsgroup thread (last post in the thread). Before running the code, make sure that the major units for both axes are not set to automatic, and that the chart is selected.

  3. #3
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Formatting graph area (2000)

    Perfect, a nice find, but I may have to take of the screen update...It flashes a bit. Results below
    Jerry

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Formatting graph area (2000)

    The fixScale macro iterates to the optimal solution, so it's a good idea to turn off screen updating while fixScale is running.

  5. #5
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Formatting graph area (2000)

    Cheers

    Was doing that as you wrote. Definitely, Application.ScreenUpdating=false is the way to go on this. <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>
    Jerry

  6. #6
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Formatting graph area (2000)

    Hans

    Further to this, do you know a method to centre the chart within the chart area. This code is great but it formats to the left!
    Jerry

  7. #7
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Formatting graph area (2000)

    Add this line somewhere after Next I, but before End With:
    <code>
    .PlotArea.Left = .ChartArea.Left + (.ChartArea.Width - .PlotArea.Width) / 2
    </code>
    The chart itself (the PlotArea) is horizontally centered within the ChartArea.

  8. #8
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Formatting graph area (2000)

    <img src=/S/grin.gif border=0 alt=grin width=15 height=15> thank you
    Jerry

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •