LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
Default Adding data labels to charts

Hi,
I have used the following code to generate a chart in my sheet:
--Code
Sub MakeAPie()
Dim title As String
Dim getstr1 As String
Dim getstr2 As String
title = "A1"
getstr1 = "A3:A9"
getstr2 = "E3:E9"
Dim chtOb As ChartObject
Set chtOb = ActiveSheet.ChartObjects.Add(100, 100, 250, 175)
With chtOb.Chart
.ChartType = xlPie
.SeriesCollection.NewSeries
.SeriesCollection(1).XValues = ActiveSheet.Range(getstr1)
.SeriesCollection(1).Values = ActiveSheet.Range(getstr2)
.SeriesCollection(1).Name = ActiveSheet.Range(title)
End With
End Sub
--Code
But I am not able to figure out how to add data labels (category &
percentage) to the chart generated above. And also I get the chart as
an object in my active sheet. How do I write the code to get it to
display in a new sheet?
Would appreciate any help on this one.
Thanks,

 
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
Charts - Align value & category data labels independently Stuart Bratesman Charts and Charting in Excel 1 February 2nd 06 06:20 PM
Inserting a new line when external data changes Rental Man Excel Discussion (Misc queries) 0 January 11th 06 07:05 PM
XL Charts: Let my mouse drag all data labels for a whole series. Stuart Bratesman Charts and Charting in Excel 1 August 10th 05 04:21 PM
Excel charts should let me select a range for data labels. Relmbo Charts and Charting in Excel 3 June 26th 05 02:33 PM
Sort pages? David Excel Discussion (Misc queries) 15 May 13th 05 11:33 PM


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

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"