Hi everybody
I have a problem regarding labels in bubble charts. I have made a macro which dynamically converts a table into a bubble chart.
My problem - I want to give each bubble a number from 1 to n in the middle of each bubble so they will be easier to keep track of.
My code is:
Sub BubbleLabel_Click2()
Dim i As Integer
finalrow = Range("A4").End(xlDown).Row
With ActiveSheet.ChartObjects.Add(Left:=700, Width:=700, Top:=150, Height:=400).Chart
'Sacrifical rows that will be lost
'X axis name
.Axes(xlCategory, xlPrimary).HasTitle = True
.Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = "XXX"
'y-axis name
.Axes(xlValue, xlPrimary).HasTitle = True
.Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "YYY"
'.SeriesCollection.NewSeries
.ChartType = xlBubble3DEffect
For i = 4 To finalrow
With .SeriesCollection.NewSeries
.Name = Rows(i).Cells(1, 1)
.XValues = Rows(i).Cells(1, 2)
.Values = Rows(i).Cells(1, 3)
.BubbleSizes = Rows(i).Cells(1, 4)
.ApplyDataLabels
.DataLabels.ShowSeriesName = False
.DataLabels.ShowValue = False
End With
Next i
.ChartType = xlBubble3DEffect
End With
End Sub
Can anybody help?
BR,
Jesper
Bookmarks