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 43 44
|
'.......................
'Colorise les séries et les nomme
With ActiveChart.SeriesCollection(1)
'.Border.Color = RGB(0, 0, 255)
.Interior.Color = RGB(0, 0, 255)
.Name = "Contrat M"
End With
With ActiveChart.SeriesCollection(2)
'.Border.Color = RGB(255, 224, 0)
.Interior.Color = RGB(255, 0, 0)
.Name = "a"
End With
'With ActiveChart.SeriesCollection(3)
'.Border.Color = RGB(255, 224, 0)
'.Font.ColorIndex = 33
'.Name = "a => b"
'End With
'Colorise les données b suivant l'ecart avec a
For D = 1 To ActiveChart.SeriesCollection(2).Points.Count
'affiche les étiquettes
ActiveChart.SeriesCollection(1).Points(D).HasDataLabel = True
ActiveChart.SeriesCollection(2).Points(D).HasDataLabel = True
'récupère les informations des étiquettes
rep1 = ActiveChart.SeriesCollection(1).Points(D).DataLabel.Text
rep2 = ActiveChart.SeriesCollection(2).Points(D).DataLabel.Text
'convertit l'étiquette en nombre et fais le test
'a >b
If CDbl(rep1) > CDbl(rep2) Then
'suivant le résultat, change la couleur
ActiveChart.SeriesCollection(2).Points(D).Interior.ColorIndex = 3
'a = b
ElseIf CDbl(rep1) = CDbl(rep2) Then
'suivant le résultat, change la couleur
ActiveChart.SeriesCollection(2).Points(D).Interior.ColorIndex = 33
Else
ActiveChart.SeriesCollection(2).Points(D).Interior.ColorIndex = 33
End If
ActiveChart.SeriesCollection(1).Points(D).HasDataLabel = False
ActiveChart.SeriesCollection(2).Points(D).HasDataLabel = False
Next
'....................... |
Partager