Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
can't center a category label on a line chart | Charts and Charting in Excel | |||
Category axis label problem at column chart | Charts and Charting in Excel | |||
label the category axis from 0 to 30, step 5 in an excel chart | Charts and Charting in Excel | |||
Add in label to the category axis on Chart | Excel Programming | |||
Series Category Label in Pie Chart | Excel Programming |