+ Reply to Thread
Results 1 to 3 of 3

Chart resizing headache.

  1. #1
    Registered User
    Join Date
    10-20-2012
    Location
    United Kingdom
    MS-Off Ver
    Excel 2003
    Posts
    2

    Chart resizing headache.

    Hello, first post here as most of my questions are answered by searching the forum but I cannot find anything relating to this problem.

    I am adding a lot of small piecharts to a Dashboard.
    The code adds the chart renames it, formats it and then resizes it before putting it in the right place.
    The code looks a bit weird because it turns out the ChartArea property of Chart is read only, and therefore it has to be accessed from ChartObjects.

    Please Login or Register  to view this content.
    The problem is the charts are not sized the same each time the code runs- I don't understand how it cannot be repeatable.

    If you step through the code the pie fills the chart area, if I run the code normally the pie is wedged in the top corner as if the chart area. How can this be?
    Last edited by senjers; 11-22-2012 at 09:22 PM.

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

    Re: Chart resizing headache.

    You need to post workbook example so we can see exactly what is created.
    If possible include a chart correctly formatted and one that the code does wrong.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    10-20-2012
    Location
    United Kingdom
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Chart resizing headache.

    Sorry to bump an old thread but I did a work around but revisiting this to do it properly I am getting the same error.

    When I step through my code using F8 the charts are positioned perfectly under the tick labels of another chart.

    When I run the code normally the new charts are not in the same place as when I stepped through the code. I just don't get how the result of the placement could depend if I step through or not. I think it must be a bug with excel. Has anyone else experienced this?

    Here is the code:
    This first part puts a stacked chart.
    Please Login or Register  to view this content.

    This part references the chart and calculates some x,y dimensions of the axis
    Please Login or Register  to view this content.
    This part then adds a pie chart and tries to place it under one of the tick labels

    Please Login or Register  to view this content.
    This works like a charm if I step throught the code but puts them in the wrong places when I just allow the code to run.
    Last edited by arlu1201; 12-10-2012 at 02:34 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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