Reputation: 11
I'm trying to format the "segments" of a sunburst chart. The chart has one series and many points.
I can format the entire series like this:
With ActiveChart
.FullSeriesCollection(1).Format.Fill.ForeColor.ObjectThemeColor = msoThemeColorAccent1
End With
and i can format an individual point like this:
With ActiveChart
.FullSeriesCollection(1).points(1).Format.Fill.ForeColor.ObjectThemeColor = msoThemeColorAccent1
End With
but i can not figure out how many points there are in each "segment" so i can format them all the same. For example, the 5th point is in the second "segment" but i can't see a way to determine that.
By "segment" i mean all the points in that wedge of the pie from the centre out.
Upvotes: 1
Views: 1063
Reputation: 135
I was recently struggling with this kind of chart, too (see here). Sunburst charts are indeed very poorly documented.
My solution to the same problem was to go through the underlying data in order to get to know how many data points there are per column. Example:
The first category with result 50% has 3 out of 5 data points, which means the innermost point has index 1, while the index of the innermost data point of the second category is 4. Third one index 6, fourth 7 and so on. Knowing this index you can color the columns as you wish.
So answering your question: Using the sunburst chart, you have to know how many data points you have per column, (as far as I could find out) you can not figure this out by going through the data points themselves.
Upvotes: 1