#1   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 2
Default Pie Charts

I am building a pie chart via code. As soon as I apply data labels, the plot
area resizes to accomodate the labels. Can I prevent this?

I've tried using the plotarea.height/width, etc. properties, but it doesn't
seem to help.

I have turned off font autoscaling. Is there a similar property for the
plot area?
  #2   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 2,489
Default Pie Charts

Hi,

Does this macro help?

Sub PieLabels()

Dim sngLeft As Single
Dim sngTop As Single
Dim sngWidth As Single
Dim sngHeight As Single

With ActiveSheet.ChartObjects(1).Chart
With .PlotArea
sngLeft = .Left
sngTop = .Top
sngWidth = .Width
sngHeight = .Height
End With

.SeriesCollection(1).ApplyDataLabels AutoText:=True,
LegendKey:=False, _
HasLeaderLines:=True,
ShowSeriesName:=False, _
ShowCategoryName:=True,
ShowValue:=False, _
ShowPercentage:=False,
ShowBubbleSize:=False

With .PlotArea
.Left = sngLeft
.Top = sngTop
.Width = sngWidth
.Height = sngHeight
End With
End With

End Sub

Cheers
Andy

--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
"Martha D." wrote in message
...
I am building a pie chart via code. As soon as I apply data labels, the
plot
area resizes to accomodate the labels. Can I prevent this?

I've tried using the plotarea.height/width, etc. properties, but it
doesn't
seem to help.

I have turned off font autoscaling. Is there a similar property for the
plot area?


  #3   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 2
Default Pie Charts

Actually, after re-booting my PC and re-running the code I already had, it
seemed to work. While I had been able to effect the left and top
positioning, the height and width commands seemed to be ignored. The re-boot
cured it - at least until I try it again today.

I did re-arrange the order of things so that I re-size the chart first, and
then apply the data labels.

Thanks.



"Andy Pope" wrote:

Hi,

Does this macro help?

Sub PieLabels()

Dim sngLeft As Single
Dim sngTop As Single
Dim sngWidth As Single
Dim sngHeight As Single

With ActiveSheet.ChartObjects(1).Chart
With .PlotArea
sngLeft = .Left
sngTop = .Top
sngWidth = .Width
sngHeight = .Height
End With

.SeriesCollection(1).ApplyDataLabels AutoText:=True,
LegendKey:=False, _
HasLeaderLines:=True,
ShowSeriesName:=False, _
ShowCategoryName:=True,
ShowValue:=False, _
ShowPercentage:=False,
ShowBubbleSize:=False

With .PlotArea
.Left = sngLeft
.Top = sngTop
.Width = sngWidth
.Height = sngHeight
End With
End With

End Sub

Cheers
Andy

--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
"Martha D." wrote in message
...
I am building a pie chart via code. As soon as I apply data labels, the
plot
area resizes to accomodate the labels. Can I prevent this?

I've tried using the plotarea.height/width, etc. properties, but it
doesn't
seem to help.

I have turned off font autoscaling. Is there a similar property for the
plot area?



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
interactive charts for stacked bar charts [email protected] Charts and Charting in Excel 4 December 28th 06 09:58 PM
Combine Clustered Column Bar charts and Stacked column bar charts Richard Charts and Charting in Excel 1 October 26th 06 02:44 AM
Pie Charts MLShef Charts and Charting in Excel 1 May 24th 06 07:49 PM
Matching the colors Column Charts and Pie Charts RohanSewgobind Charts and Charting in Excel 3 April 21st 06 09:35 PM
Help with charts. HRassist Charts and Charting in Excel 5 September 22nd 05 07:35 PM


All times are GMT +1. The time now is 03:01 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"