1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
|
ActiveChart.SeriesCollection(1).Select
With ActiveChart.SeriesCollection(1)
ActiveChart.SeriesCollection(1).DataLabels.Select
'Memorisation du contenu des etiquettes
Dim EtiCAT As Boolean, EtiVAL As Boolean, EtiPRC As Boolean 'Respectivement: Catégorie (point), Valeur, Pourcentage
EtiCAT = Selection.ShowCategoryName
EtiVAL = Selection.ShowValue
EtiPRC = Selection.ShowPercentage
'Ne laisser que les noms de catégories dans les étiquettes
Selection.ShowCategoryName = True
Selection.ShowValue = False
Selection.ShowPercentage = False
ActiveChart.SeriesCollection(1).HasLeaderLines = False
ActiveChart.SeriesCollection(1).DataLabels.AutoText = True
Dim MesPoints As Series
Dim MaVal As String
For Each P In .Points
P.Select
MaVal = P.DataLabel.TEXT
Select Case MaVal
Case "CATEGORIE1"
P.Select
Selection.Format.Fill.ForeColor.RGB = RGB(31, 73, 125)
Selection.Format.Line.ForeColor.RGB = RGB(31, 73, 125)
Case "CATEGORIE2"
P.Select
Selection.Format.Fill.ForeColor.RGB = RGB(128, 100, 162)
Selection.Format.Line.ForeColor.RGB = RGB(128, 100, 162)
Case "CATEGORIE3"
P.Select
Selection.Format.Fill.ForeColor.RGB = RGB(0, 112, 192)
Selection.Format.Line.ForeColor.RGB = RGB(0, 112, 192)
End Select
Next
ActiveChart.SeriesCollection(1).DataLabels.ShowCategoryName = EtiCAT
ActiveChart.SeriesCollection(1).DataLabels.ShowValue = EtiVAL
ActiveChart.SeriesCollection(1).DataLabels.ShowPercentage = EtiPRC
ActiveChart.SeriesCollection(1).DataLabels.AutoText = True
End With |
Partager