ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   No Data Lables (https://www.excelbanter.com/excel-programming/423002-no-data-lables.html)

Michael Hudston

No Data Lables
 
Can anyone tellme why the Datalables wont appear on the chart? Despite me
putting True for Percentage and Category?



Range("H2").Select
ActiveSheet.Shapes.AddChart.Select
ActiveChart.ChartType = xl3DPieExploded
ActiveChart.SetSourceData Source:=Sheets("CHART
DATA").Range("C3:C51")
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(1).Name = "='CHART
DATA'!$B$3:$B$51"
ActiveChart.SeriesCollection(1).Values = "='CHART
DATA'!$C$3:$C$51"
ActiveChart.SeriesCollection(1).XValues = "='CHART
DATA'!$B$3:$B$51"

ActiveChart.Parent.Top = Range("H2").Top
ActiveChart.Parent.Left = Range("H2").Left
ActiveChart.Parent.Width = Range("H2:S26").Width
ActiveChart.Parent.Height = Range("H2:S26").Height

ActiveChart.ChartTitle.Select
ActiveChart.ChartTitle.Text = "LRU By Percentage of
Distribution"

ActiveChart.SeriesCollection.ApplyDataLabels
ActiveChart.SeriesCollection.DataLabels.Select
Selection.ShowPercentage = True
Selection.ShowCategoryName = True

ActiveChart.Legend.Select
Selection.Delete


Andy Pope

No Data Lables
 
Hi,

You need to apply the data labels to a specific series.

ActiveChart.SeriesCollection(1).ApplyDataLabels

But I would change the chart type if I was you. Trying to read 51 slices
in a pie will be impossible. And the data labels will overlap for sure.

Cheers
Andy


Michael Hudston wrote:
Can anyone tellme why the Datalables wont appear on the chart? Despite me
putting True for Percentage and Category?



Range("H2").Select
ActiveSheet.Shapes.AddChart.Select
ActiveChart.ChartType = xl3DPieExploded
ActiveChart.SetSourceData Source:=Sheets("CHART
DATA").Range("C3:C51")
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(1).Name = "='CHART
DATA'!$B$3:$B$51"
ActiveChart.SeriesCollection(1).Values = "='CHART
DATA'!$C$3:$C$51"
ActiveChart.SeriesCollection(1).XValues = "='CHART
DATA'!$B$3:$B$51"

ActiveChart.Parent.Top = Range("H2").Top
ActiveChart.Parent.Left = Range("H2").Left
ActiveChart.Parent.Width = Range("H2:S26").Width
ActiveChart.Parent.Height = Range("H2:S26").Height

ActiveChart.ChartTitle.Select
ActiveChart.ChartTitle.Text = "LRU By Percentage of
Distribution"

ActiveChart.SeriesCollection.ApplyDataLabels
ActiveChart.SeriesCollection.DataLabels.Select
Selection.ShowPercentage = True
Selection.ShowCategoryName = True

ActiveChart.Legend.Select
Selection.Delete


--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info

Michael Hudston

No Data Lables
 
Cheers Andy, I am considering different graph types at this time.

"Andy Pope" wrote:

Hi,

You need to apply the data labels to a specific series.

ActiveChart.SeriesCollection(1).ApplyDataLabels

But I would change the chart type if I was you. Trying to read 51 slices
in a pie will be impossible. And the data labels will overlap for sure.

Cheers
Andy


Michael Hudston wrote:
Can anyone tellme why the Datalables wont appear on the chart? Despite me
putting True for Percentage and Category?



Range("H2").Select
ActiveSheet.Shapes.AddChart.Select
ActiveChart.ChartType = xl3DPieExploded
ActiveChart.SetSourceData Source:=Sheets("CHART
DATA").Range("C3:C51")
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(1).Name = "='CHART
DATA'!$B$3:$B$51"
ActiveChart.SeriesCollection(1).Values = "='CHART
DATA'!$C$3:$C$51"
ActiveChart.SeriesCollection(1).XValues = "='CHART
DATA'!$B$3:$B$51"

ActiveChart.Parent.Top = Range("H2").Top
ActiveChart.Parent.Left = Range("H2").Left
ActiveChart.Parent.Width = Range("H2:S26").Width
ActiveChart.Parent.Height = Range("H2:S26").Height

ActiveChart.ChartTitle.Select
ActiveChart.ChartTitle.Text = "LRU By Percentage of
Distribution"

ActiveChart.SeriesCollection.ApplyDataLabels
ActiveChart.SeriesCollection.DataLabels.Select
Selection.ShowPercentage = True
Selection.ShowCategoryName = True

ActiveChart.Legend.Select
Selection.Delete


--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info



All times are GMT +1. The time now is 11:41 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com