Pie Chart sizing

Showard27

Board Regular
Joined
Sep 5, 2005
Messages
155
Dear all

Am developing a dashboard which sizes a series of pie charts according to 1 set of variables. the contents of the pies are set from a second set of variables.

To set the pie diameter I use a routine earlier in the code which calculates the radius "P1R" where the center line of the chart is defined as "P1C". and the horizontal bottom of the chart sits on a line I name "xvert". I then size the chart using the following code:

Code:
    With ActiveSheet.ChartObjects(1)
        .Top = xvert - (p1r * 2)
        .Left = p1c - p1r
        .Width = p1r * 2
        .Height = p1r * 2
        .Activate
    End With
However this only sets the overall chart size, so I then set the plot area. to do this is send top left to 0,0, and discovered if I stretched the pie beyond the bounds, it sizes to the chart area set above, so the following code should work (I set the pie to 10000 as a notional figure way larger than the chart area). The values are also passed from an array populated from earlier in the routine:
Code:
        ActiveChart.FullSeriesCollection(1).Values = pie1
        ActiveChart.PlotArea.Select
        With Selection
            .Top = 0
            .Left = 0
            .Width = 10000
            .Height = 10000
        End With
for some reason this is not working correctly on every occasion. I seem to have an inset sometimes from the edge of the chart area. Can anyone point me in the right direction on this one?
Many thanks in advance

Simon
 

Some videos you may like

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK

Showard27

Board Regular
Joined
Sep 5, 2005
Messages
155
Hi all

Update on my previous post.

I have discovered some things called: InsideTop, InsideLeft, InsideWidth, and InsideHeight. These seem to have made a difference, but as usual the MS site's explanations are less than helpful, so not sure I fully understand what they are doing yet, and why they are different to the previously used Top, Left, Width, Height.

S
 
Last edited:

Watch MrExcel Video

Forum statistics

Threads
1,123,154
Messages
5,600,024
Members
414,356
Latest member
death20

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top