VBA to change 3-D Rotation on Pie Chart

joezimo

New Member
Joined
Mar 26, 2004
Messages
48
I can't seem to figure out how to change the following in xl3DPieExploded Chart:

3-D Rotation: X = 0, Y = 30, Perspective = 15

I have the following:

With ActiveSheet.ChartObjects.Add(Left:=25, Width:=450, Top:=150, Height:=350)
.Chart.SetSourceData Source:=Sheets("LoanType").Range("A1").CurrentRegion
.Chart.ChartType = xl3DPieExploded
.Chart.Legend.Position = xlBottom
.Chart.ChartTitle.Text = "IRE By Loan Type"

End With

ActiveSheet.ChartObjects.Select

ActiveChart.SeriesCollection(1).ApplyDataLabels
ActiveChart.SeriesCollection(1).DataLabels.Select
Selection.ShowCategoryName = True
Selection.ShowValue = False
Selection.ShowPercentage = True
Selection.Position = xlLabelPositionOutsideEnd

ActiveChart.Rotation = 30
ActiveChart.Perspective = 15

But when I look at the chart after this runs, I see:

3-D Rotation: X = 30, Y = 15, Perspective = 7.5

I've been searching for how to set these properly and can't seem to come up with any solutions. Any guidance would be appreciated.

Joe
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Hi Joe,

Try the following:

Code:
    ActiveChart.ChartArea.Select
    With ActiveChart
        .Elevation = 30
        .Perspective = 15
        .Rotation = 0
    End With

/Comf
 
Upvote 0
Wow, that was easy. Thank you for the quick reply. This is my first stint at creating charts using VBA and this was one of the formats I could not get my arms around.

Thanks again!
 
Upvote 0

Forum statistics

Threads
1,213,551
Messages
6,114,266
Members
448,558
Latest member
aivin

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
Back
Top