Hi all,
Below I have a "standard" sunburst chart, where I want to do 2 things, 1 to create a ring or segment of the same color and/or 2, to create a color of an individual item, based on the cell content. I have got so far information that I know that the graph is handling points, but in this particular case the number of individual points does not go beyond 16 where Points.Count = 24. That puzzles me.
In this case I want to have "Okt" in green and "-0,8" in red
I probably am making a thinking error, but I failed to see where.
Sub ModifyTreeMap()
Dim t, pnts, sr
ActiveSheet.Shapes.Range("Chart 2").Select
sr = ActiveChart.FullSeriesCollection.Count
pnts = ActiveChart.FullSeriesCollection(sr).Points.Count
For t = 1 To pnts
With ActiveChart.FullSeriesCollection(sr).Points(t)
' Debug.Print ActiveChart.FullSeriesCollection(sr).Points(t).DataLabel.Text
If Left(ActiveChart.FullSeriesCollection(sr).Points(t).DataLabel.Text, 2) = "wk" Then .Format.Fill.ForeColor.RGB = vbGreen
If ActiveChart.FullSeriesCollection(sr).Points(t).DataLabel.Text = "Okt" Then .Format.Fill.ForeColor.RGB = vbGreen
If ActiveChart.FullSeriesCollection(sr).Points(t).DataLabel.Text = "-0,8" Then .Format.Fill.ForeColor.RGB = vbRed
End With
Next t
[g2].Select
End Sub
Please can you help me out?
Cheers
Erwin
Bookmarks