Hi all,
I just joined MrExcel because I was freaking out.
I am generating 4 different Pivot Pie Charts with Data coming from an external Excel File.
It works pretty fine.
Actually the 4 Pies are displaying the same data but each pie has a different filter on it. So I get in Pie 1 all the data where "Severity = Critical"
and in the second one where Severity = High, and so on...
The problem is: The color schemes are automatically changed when there are not the same amount of catagories.
As you can see: "09 Test Data Issue" has a different color in Pie1 than in Pie 2 (because 07 and 08 don't exist).
Does any one know how to set specific chart categories to a specific color programmatically?
I've tried this when creating the chart, but this doesn't work:
Thanks in advance.
Tuga
I just joined MrExcel because I was freaking out.
I am generating 4 different Pivot Pie Charts with Data coming from an external Excel File.
It works pretty fine.
Actually the 4 Pies are displaying the same data but each pie has a different filter on it. So I get in Pie 1 all the data where "Severity = Critical"
and in the second one where Severity = High, and so on...
The problem is: The color schemes are automatically changed when there are not the same amount of catagories.

As you can see: "09 Test Data Issue" has a different color in Pie1 than in Pie 2 (because 07 and 08 don't exist).
Does any one know how to set specific chart categories to a specific color programmatically?
I've tried this when creating the chart, but this doesn't work:
Code:
With .Chart.SeriesCollection(1)
For i = 1 To .Points.Count
With .Points(i)
PointText = .DataLabel.Text
Select Case PointText
Case "01 Environment Issue (Detected in ST)"
.Format.Fill.ForeColor.RGB = RGB(0, 0, 255)
Case "02 Deployment Issue (Detected in ST)"
.Format.Fill.ForeColor.RGB = RGB(218, 165, 32)
Case "03 Requirements Issue (Detected in ST)"
.Format.Fill.ForeColor.RGB = RGB(139, 69, 19)
Case "04 Design Issue (Detected in ST)"
.Format.Fill.ForeColor.RGB = RGB(119, 136, 153)
Case "05 Code Issue (Detected in ST)"
.Format.Fill.ForeColor.RGB = RGB(0, 100, 0)
Case "07 Test Design Issue (Detected in ST/AT)"
.Format.Fill.ForeColor.RGB = RGB(178, 34, 34)
Case "08 Test Execution Issue (Detected in ST/AT)"
.Format.Fill.ForeColor.RGB = RGB(147, 112, 219)
Case "09 Test Data Issue (Detected in ST)"
.Format.Fill.ForeColor.RGB = RGB(0, 191, 255)
More Cases
End Select
.HasDataLabel = False
End With
Next i
End With
Thanks in advance.
Tuga