+ Reply to Thread
Results 1 to 7 of 7

Set the plot area to centre based on cell size

  1. #1
    Forum Contributor
    Join Date
    02-14-2007
    Location
    Chester, England
    MS-Off Ver
    2010 & 2016
    Posts
    312

    Set the plot area to centre based on cell size

    Hello all

    I have managed to put together a bit of code to resize a pie chart. It seems to work ok when resizing the chart area and will also resize the Plot Area but I would like to be able to then make the pie sit in the centre. This bit of code does seem to do all 3 parts but when it centres the pie it also resizes it back to being very small.

    Is it possible to centre the plot area and keep the required size?

    This is what I have so far.
    Please Login or Register  to view this content.

    The reason I have done this a code is because I am intending to do this for many charts.

    Thanks in advance ofr any advice.

    Cheers

    Jim
    Last edited by JimmyA; 10-19-2010 at 11:16 AM.

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

    Re: Set the plot area to centre based on cell size

    The plot area is square for pie and donut charts so you only need to adjust Width or Height.

    You may have problem making the plot area the same size as the chartarea.
    Also setting the Width or Height beyond the chartarea size will end up setting the size to the largest one that will fit.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Forum Contributor
    Join Date
    02-14-2007
    Location
    Chester, England
    MS-Off Ver
    2010 & 2016
    Posts
    312

    Re: Set the plot area to centre based on cell size

    Hi Andy

    Thanks very much yet again for taking the time to help me. I have tried only adjusting the width of the plot area but I am still left with the problem of the pie being taken off centre.

    I have attached an example to show you what I mean. I have also tried reducing the plot size by the cell width minus 2 or trying to multiply the cell width by 0.8 but both still have the same problem of sending the pie off centre.

    Any ideas of what I can do?

    Thanks

    Jim
    Attached Files Attached Files
    Last edited by JimmyA; 10-19-2010 at 10:46 AM. Reason: VBA did not work in attachment

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

    Re: Set the plot area to centre based on cell size

    Is you example too large?

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

    Re: Set the plot area to centre based on cell size

    try something like this

    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    02-14-2007
    Location
    Chester, England
    MS-Off Ver
    2010 & 2016
    Posts
    312

    Re: Set the plot area to centre based on cell size

    This is the size that is created when I insert a Pie Chart, The code reduces the chart to the size of cell L8 but I would also like it to place in the centre.

    Thanks again

    Jim

  7. #7
    Forum Contributor
    Join Date
    02-14-2007
    Location
    Chester, England
    MS-Off Ver
    2010 & 2016
    Posts
    312

    Re: Set the plot area to centre based on cell size

    Thats great, Thanks very much for your help.

    Jim

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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