Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Setting the category Label source for a Pie chart

I have a macro to set up the source data for a Piechart as below

With Worksheets("Summary_report").chartobjects(9).chart
.setsourcedata source:=range(range_string), plotby:=xlcolumn
end with
The range_string is constructed by the macro before. As this is a Pie chart
the range is a single column only but the range values are not contiguous.
Similarly I want to set the category labels also programmatically but unable
to find a suitable method / property in Chart object that will achieve this.
The chartwizard method has an optional variant "categorylabels" but does not
seem to work for Pie chart. Any help would be greatly appreciated

Thanks, Sesh
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Setting the category Label source for a Pie chart

Hi Sesh,

Have you tried the macro recorder?
The bare minimum for "categorylabels", ie x-axis value

..SeriesCollection(1).ApplyDataLabels xlDataLabelsShowLabel

Alternatively for a bit more control
Dim sr As Series, dlbls As Datalabels
set sr = cht.SeriesCollection(1)
sr.HasDataLabels = True
Set dlbls = sr.DataLabels
stop
now look at dlbls in Locals, Alt-v, s

Regards,
Peter T

"Seshadrinathan" wrote in message
...
I have a macro to set up the source data for a Piechart as below

With Worksheets("Summary_report").chartobjects(9).chart
.setsourcedata source:=range(range_string), plotby:=xlcolumn
end with
The range_string is constructed by the macro before. As this is a Pie

chart
the range is a single column only but the range values are not contiguous.
Similarly I want to set the category labels also programmatically but

unable
to find a suitable method / property in Chart object that will achieve

this.
The chartwizard method has an optional variant "categorylabels" but does

not
seem to work for Pie chart. Any help would be greatly appreciated

Thanks, Sesh



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
can't center a category label on a line chart Harold Good Charts and Charting in Excel 1 February 9th 10 05:58 AM
Category axis label problem at column chart Marko Pinteric Charts and Charting in Excel 9 April 24th 06 02:40 PM
label the category axis from 0 to 30, step 5 in an excel chart johnny hanlon Charts and Charting in Excel 2 January 29th 06 12:12 AM
Add in label to the category axis on Chart Chen Yan Excel Programming 0 October 16th 03 08:29 AM
Series Category Label in Pie Chart Jon Peltier[_4_] Excel Programming 0 September 28th 03 12:44 AM


All times are GMT +1. The time now is 08:57 PM.

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"