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
| Sub Construire_Graphe()
' ******************************************
' ** Construire le graphe en fonction d'un des settings **
' ******************************************
Dim Abscisses(), Ordonnees() As Single
Dim Iter As Integer
Dim Pas As Single
Dim oChart As ChChart
Dim oSeries, oConst As Object
' ** Construction des données à tracer **
' *******************************
' Redimensionnement du vecteur d'abscisses
Iter = 10
ReDim Abscisses(Iter)
ReDim Ordonnees(Iter)
Pas = (Manager_Usf.Ferrous_scroll.Max - Manager_Usf.Ferrous_scroll.Min) / Iter
' Construction des vecteurs Abscisses et Ordonnées
For i = 0 To Iter
Abscisses(i) = i * Pas
Manager_Usf.Ferrous_scroll.Value = Abscisses(i)
Call MaJ_SaleRates
Call Calc_CoutSubset
Call EnvoiSubsets
Ordonnees(i) = PostTreatment.Cells(PhaseIIRow, 15).Value
Next i
' ** Traçage du graphe **
' *******************
Manager_Usf.ChartSpace1.Clear
Set oConst = Manager_Usf.ChartSpace1.Constants
' Création diagramme dans le ChartSpace
Set oChart = Manager_Usf.ChartSpace1.Charts.Add
oChart.Type = oConst.chChartTypeScatterLine
' Création de la série
oChart.SeriesCollection.Add
With oChart.SeriesCollection(0)
.Caption = "Ferrous"
.Type = oConst.chChartTypeScatterLine
.SetData oConst.chDimXValues, oConst.chDataLiteral, Abscisses()
.SetData oConst.chDimYValues, oConst.chDataLiteral, Ordonnees()
End With
End Sub |
Partager