Slt, je decouvre le contrôle mschart et pour mieux l'appréhender je fais un exo que j'ai vu sur un tutoriel
il ya base de donnée qui est liée par un contrôle adodc1.
ENSUITE JE REnseigne la propriété datasource de mschart par adodc
le reste du code suivant est dans l'évènement load de la feuille
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
Dim i As Integer
Dim moymax As Double
 MSChart1.AllowSelections = False
 With MSChart1
  .chartType = VtChChartType2dBar
  .ColumnCount = 1     'nombre de barre
  .RowCount = 12        ' nombre de mois
  For i = 1 To 12
  .Row = i
  .Column = 1
  .RowLabel = Adodc1.Recordset.Fields(0)  'le nom de chaque mois
  .Data = Adodc1.Recordset.Fields(1).Value 'valeur du champ température max
 'moymax = 0
  moymax = moymax + Adodc1.Recordset.Fields(1)
  Adodc1.Recordset.MoveNext
  Next i
 End With
 moymax = Format(moymax / 12, "#0.0")
 MSChart1.DoSetCursor = True
 MSChart1.MousePointer = VtMousePointerArrowQuestion
  'TITRES, LEGENDES, NOTES
MSChart1.ShowLegend = True
 With MSChart1.Plot.SeriesCollection(1)
  .LegendText = "T° MAX"
 End With
 
 With MSChart1.Legend
  .Location.LocationType = VtChLocationTypeTop
  .TextLayout.HorzAlignment = VtHorizontalAlignmentCenter
  .VtFont.VtColor.Set 255, 255, 0
 .Backdrop.Fill.Style = VtFillStyleBrush
  .Backdrop.Fill.Brush.Style = VtBrushStyleSolid
  .Backdrop.Fill.Brush.FillColor.Set 159, 0, 255
 End With
 
 'TITRES DU GRAPHE ET MISE EN FORME
 MSChart1.TitleText = "TEMPERATURES ANNUELLES"
 With MSChart1.Title.VtFont
  .Name = "comic sans ms"
  .Size = 15
  .Effect = VtFontEffectUnderline
 End With
 'TITRE POUR L'AXE DES Y COTE GAUCHE
 With MSChart1.Plot.Axis(1, 1)
  .AxisTitle.VtFont.Size = 14
 .AxisTitle.Visible = True
 .AxisTitle.Text = "temperatures"
 End With
 'TITRE POUR L'AXE DES Y COTE DROIT
 With MSChart1.Plot.Axis(2, 1)
  .AxisTitle.VtFont.Size = 14
 .AxisTitle.Visible = True
 .AxisTitle.Text = "temperatures"
 End With
 'TITRE POUR L'AXE DES X
 With MSChart1.Plot.Axis(0, 1)
  .AxisTitle.VtFont.Size = 14
 .AxisTitle.Visible = True
 .AxisTitle.Text = "MOIS"
 End With
 MSChart1.FootnoteText = "Notes: ces températures sont données par l'institut national de météréologie"
mon problème est que ne s'affiche pas les champs de la table à savoir (janvier,février...décembre) ainsi que le le text du titre pour l'axe des X,Yà savoir(temperatures,mois)
merci de m'éclairer