Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
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 | |||
Column chart - category axis - make to start with the second label | Excel Discussion (Misc queries) | |||
Column chart - category axis - make to start with the second label | Charts and Charting in Excel | |||
label the category axis from 0 to 30, step 5 in an excel chart | Charts and Charting in Excel |