LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 90
Default Series Category Label in Pie Chart

Brad -

You want the XValues, as in this short macro:

Sub MakeAPie()
Dim chtOb As ChartObject
Set chtOb = ActiveSheet.ChartObjects.Add(100, 100, 250, 175)
With chtOb.Chart
.ChartType = xlPie
.SetSourceData Source:=Sheets("Sheet1").Range("F11")
.SeriesCollection.NewSeries
.SeriesCollection(1).XValues = ActiveSheet.Range("B9:B11")
.SeriesCollection(1).Values = ActiveSheet.Range("C9:C11")
.SeriesCollection(1).Name = ActiveSheet.Range("C8")
End With
End Sub

- Jon
-------
Jon Peltier, Microsoft Excel MVP
http://www.geocities.com/jonpeltier/Excel/index.html
_______


Brad wrote:
Good morning.

I'm interested in changing the series category labels in a
chart that I'm creating using VBA. When I generate the
chart using the ChartWizard method, my pie chart has a
legend that just has the different colored markers, but no
labels. And try as I might, I can't figure how to label
them. I'd like to label them dynamically using a range of
cells, similar to the "Source DataSeries TabCategory
Labels:" field when modifying the chart directly.

For example:
Set cobPie = shtCurrent.ChartObjects.Add(0, 400, 450,
350)
cobPie.Chart.ChartWizard rngSource, xlPie,
PlotBy:=xlRows, CategoryLabels:=0, _
SeriesLabels:=0,
HasLegend:=True, Title:=strName


The CategoryLabels parameter only receives an integer
datatype..and I can not include the Category Labels in the
source of my chart (at least I'd rather not.)

Is there anyway to access this property directly?

Thanks for the help!

-Brad


 
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
Column chart - category axis - make to start with the second label Marko Pinteric Excel Discussion (Misc queries) 3 April 10th 06 09:31 AM
Column chart - category axis - make to start with the second label Marko Pinteric Charts and Charting in Excel 3 April 10th 06 09:31 AM
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


All times are GMT +1. The time now is 02:22 PM.

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

About Us

"It's about Microsoft Excel"