Sub couleur_texte_fond()
Application.ScreenUpdating = False
ActiveChart.Axes(xlCategory).Select
'ActiveChart.Axes(xlCategory).MinimumScale = 0
ActiveChart.Axes(xlValue).TickLabels.Font.Size = 7
ActiveChart.Axes(xlCategory).TickLabels.Font.Size = 7
'--titres
With ActiveChart
.HasTitle = True
.ChartTitle.Characters.Text = Sheets("data").Cells(2, 2) & "/" & Sheets("data").Cells(2, 3)
.Axes(xlCategory, xlPrimary).HasTitle = True
.Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = Sheets("data").Cells(2, 2)
.Axes(xlValue, xlPrimary).HasTitle = True
.Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = Sheets("data").Cells(2, 3)
End With
'
ActiveChart.Axes(xlValue).HasMajorGridlines = True
ActiveChart.Axes(xlCategory).HasMajorGridlines = True
ActiveChart.SeriesCollection(1).Select
Selection.Has3DEffect = True
ActiveChart.SeriesCollection(1).DataLabels.Select
Selection.Font.Size = 7
Nb_points = ActiveChart.SeriesCollection(1).Points.Count
For i = 1 To Nb_points
'---- texte
ActiveChart.SeriesCollection(1).Points(i).DataLabel.Select
Selection.Text = Sheets("data").Cells(i + 2, 1) & ": " & Sheets("data").Cells(i + 2, 4) & " K"
Selection.Interior.ColorIndex = Sheets("data").Cells(i + 2, 4).Interior.ColorIndex
Selection.Font.ColorIndex = Sheets("data").Cells(i + 2, 4).Font.ColorIndex
'-- couleur graphe
ActiveChart.SeriesCollection(1).Points(i).Select
Selection.Interior.ColorIndex = Sheets("data").Cells(i + 2, 4).Interior.ColorIndex
Next i
On Error Resume Next
ActiveChart.Legend.Delete
End Sub