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 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
|
Sub Chart_assembl()
Dim ChartObj As ChartObject
Dim Jerome As Series
Dim claire As Series
Dim henri As Series
On Error Resume Next
ActiveSheet.ChartObjects("MYCHART1").Delete 'DELELTE ANY OLDER CHARTS IN THE SHEET
Set ChartObj = ActiveSheet.ChartObjects.Add(Left:=20, Top:=200, Width:=400, Height:=400) 'CREATE A NEW CHART
ChartObj.Chart.HasTitle = True
ChartObj.Chart.ChartTitle.Caption = "SPOC" 'OK ou ChartObj.Chart.ChartTitle.Text = "SPOC" 'OK
ChartObj.Name = "MYCHART1"
'*************************************
With ChartObj.Chart
With .Axes(xlCategory)
.HasTitle = True
With .AxisTitle
.Font.Size = 10
.Font.Bold = True
.Characters.Text = " Mois "
End With
End With
With .Axes(xlValue, xlPrimary)
.HasTitle = True
With .AxisTitle
.Font.Size = 10
.Font.Bold = True
.Characters.Text = "Echelle des heures"
End With
End With
With .Axes(xlValue, xlPrimary) 'Y Ordonnée, côté Gauche
.MaximumScale = 23 ' Valeur maximum 23 jours ouvrable max
.MinimumScale = 1 'Valeur minimum
.MajorUnit = 1 'Intervalle de l'echelle
End With
'*********************************
End With
'***************************************
Set Jerome = ChartObj.Chart.SeriesCollection.NewSeries
With Jerome
.Name = "JÉRÔME" '
.Values = S602662() 'Le tableau du même nom
.XValues = tab_mois() 'ordonnée
.ChartType = xlColumnClustered
End With
Set claire = ChartObj.Chart.SeriesCollection.NewSeries
With claire
.Name = "Claire"
.Values = S601025() 'Le tableau du même nom
.ChartType = xlColumnClustered
End With
Set henri = ChartObj.Chart.SeriesCollection.NewSeries
With henri
.Name = "Henri"
.Values = S610906() 'Le tableau du même nom
.ChartType = xlColumnClustered
End With
'MsgBox ChartObj.Chart.SeriesCollection.Count 'Me donne le nombre de serie dans le gragpique
'Application.StatusBar = ChartObj.TopLeftCell.Address & " : " & ChartObj.BottomRightCell.Address
End Sub |
Partager