mongraph.Titles.Add("Production ligne " & ligne & " à " & Date.Now.ToString) Dim oradb = "Data Source=GFOSP;User Id=XTIME;Password=xtime;" Dim conn As New OracleConnection(oradb) mongraph.Series("PRODUIT").Points.Clear() mongraph.Series("PRODUIT").BorderWidth = 4 mongraph.Series("THEORIQUE").Points.Clear() mongraph.Series("THEORIQUE").BorderWidth = 4 mongraph.Series("CUMUL").Points.Clear() mongraph.Series("CUMUL").BorderWidth = 4 mongraph.Series("CUMULTHEORIQUE").Points.Clear() mongraph.Series("CUMULTHEORIQUE").BorderWidth = 4 mongraph.Series(2).ChartType = SeriesChartType.Line mongraph.Series(1).ChartType = SeriesChartType.Line mongraph.Series(0).ChartType = SeriesChartType.Line mongraph.Series(3).ChartType = SeriesChartType.Line 'on recupere les données de performances des différents catégories conn.Open() Dim query = File.OpenText(Application.StartupPath & "\" & ligne & ".sql").ReadToEnd() Dim CommandSQL As New OracleCommand(query, conn) Dim ReadSQL As OracleDataReader = CommandSQL.ExecuteReader() ReadSQL.Read() If ReadSQL.HasRows = False Then If mongraph.Titles.Count > 0 Then mongraph.Titles.RemoveAt(0) mongraph.Titles.Add("Pas de données de production " & ligne & " pour ce poste à" & Date.Now.ToString) Exit Sub End If Dim cumul = 0 Dim cumultheo = 0 Dim j = 0 For i = 7 To 28 Step 3 Dim p1 As New DataPoint 'produit Dim p2 As New DataPoint 'théorique Dim p3 As New DataPoint 'cumul Dim p4 As New DataPoint 'cumulthéori p1.XValue = j p1.AxisLabel = ReadSQL.GetValue(i).ToString p1.YValues = {CType(ReadSQL.GetValue(i + 1), Double)} cumul = cumul + ReadSQL.GetValue(i + 1) p1.Label = ReadSQL.GetValue(i + 1).ToString p2.XValue = j p2.YValues = {CType(ReadSQL.GetValue(i + 2), Double)} p2.Label = ReadSQL.GetValue(i + 2).ToString cumultheo = cumultheo + ReadSQL.GetValue(i + 2) mongraph.Series("PRODUIT").Points.Add(p1) mongraph.Series("THEORIQUE").Points.Add(p2) mongraph.Series("CUMUL").Points.AddXY(j, {CType(cumul, Double)}) mongraph.Series("CUMULTHEORIQUE").Points.AddXY(j, {CType(cumultheo, Double)}) j = j + 1 Next conn.Dispose() conn.Close()
Modifié par jordane45 le 25/10/2014 à 15:19
EDIT : Ajout des balises de code ;-)
27 oct. 2014 à 10:29
mongraph.ChartAreas(0).AxisX.Minimum = 0
mongraph.ChartAreas(0).AxisX.Maximum = 7
et le tour est joué, merci pour ton aide et je vais virer mon adresse mail dans ma sign' pas de soucis ;-)