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 71 72 73
| #######################################################################################
' MISE EN PLACE DU GRAPHIQUE
' #######################################################################################
Dim S1 As Object
Dim TabAbscisses(), TabOrdonnees(), TabOrdonnees1(), TabOrdonnees2(), TabOrdonnees3()
Dim Cht As ChChart
Dim C As Object
ChartSpace1.Clear
ChartSpace1.Refresh
ReDim TabAbscisses(0 To dercol_global - 2)
ReDim TabOrdonnees(0 To dercol_global - 2)
ReDim TabOrdonnees1(0 To dercol_global - 2)
ReDim TabOrdonnees2(0 To dercol_global - 2)
ReDim TabOrdonnees3(0 To dercol_global - 2)
'Remplissage des tableaux qui serviront à créer le graphique
For i = 0 To dercol_global - 2
TabAbscisses(i) = Right(sheets("Entrées").Cells(6, i + 2).Value, Len(sheets("Entrées").Cells(6, i + 2).Value) - 8)
TabOrdonnees(i) = sheets("Entrées").Cells(Ligne_Ref, i + 2).Value
TabOrdonnees1(i) = sheets("Sorties").Cells(Ligne_Ref, i + 2)
TabOrdonnees2(i) = sheets("Stock BAAN").Cells(Ligne_Ref, i + 2)
TabOrdonnees3(i) = sheets("Stock SAPHIR").Cells(Ligne_Ref, i + 2)
Next i
Set C = ChartSpace1.Constants
Set Cht = ChartSpace1.Charts.Add
With Cht
'Type de graphique
.Type = C.chChartTypeScatterLineMarkers
.HasLegend = True
.Legend.Position = C.chLegendPositionBottom
End With
Set S1 = Cht.SeriesCollection.Add
With S1
.Caption = "Entrées"
.Type = C.chChartTypeColumnClustered
.SetData C.chDimCategories, C.chDataLiteral, TabAbscisses
.SetData C.chDimValues, C.chDataLiteral, TabOrdonnees
End With
Set S1 = Cht.SeriesCollection.Add
With S1
.Caption = "Sorties"
.Type = C.chChartTypeColumnClustered
.SetData C.chDimCategories, C.chDataLiteral, TabAbscisses
.SetData C.chDimValues, C.chDataLiteral, TabOrdonnees1
End With
Set S1 = Cht.SeriesCollection.Add
With S1
.Caption = "Stock BAAN"
.Type = C.chChartTypeLine
.SetData C.chDimCategories, C.chDataLiteral, TabAbscisses
.SetData C.chDimValues, C.chDataLiteral, TabOrdonnees2
.Line.Color = RGB(0, 64, 224)
End With
Set S1 = Cht.SeriesCollection.Add
With S1
.Caption = "Stock SAPHIR"
.Type = C.chChartTypeLine
.SetData C.chDimCategories, C.chDataLiteral, TabAbscisses
.SetData C.chDimValues, C.chDataLiteral, TabOrdonnees3
.Line.Color = RGB(255, 0, 0)
End With |
Partager