bonjour à tous;
j'ai un probleme que j'arrive pas à resodre depuis ce matin, je bédouille mais pour rien!!!!!!!!!voilà mon probleme je vais créer 6 graphique pour l'instant j'ai crée trois et c dejà le bazard!!je n'arrive pas à les positionner un apres l'autre et en plus la zone de traçage est petite les labele coiside avec les titre!!!!!!!!alors j'ai utiliser l'enregistreur macro pour copier les bonne dimension mais ça ne marche pas? aidez moi svp le bedouilliage ne marche pas sauf s'il ya une autre méthode, voici mon code et merci par avance

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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
'------------------------------------------------------------------
'tracer le graphe: la production en nombre de dossiers selon le grade risque "Conso"
titre1 = "Production en nombre par grade de risque 'conso'"
Set graph = Charts.Add
With graph
.ChartType = xlPie
.SetSourceData Source:=[Feuil9].Range("B15:F16"), PlotBy:=xlRows
.HasTitle = True
.ChartTitle.Characters.Text = titre1
.ChartTitle.Left = .ChartArea.Width
.ChartTitle.Left = .ChartTitle.Left / 2
decal = .ChartArea.Width / 2 - (.PlotArea.Left + .PlotArea.Width / 2)
.ChartTitle.Left = .ChartTitle.Left - decal
.ChartArea.Border.Weight = 2
.PlotArea.Top = 50
.PlotArea.Width = 350
.PlotArea.Height = 174
.PlotArea.Left = 100
.PlotArea.Top = 75
End With
ActiveChart.ApplyDataLabels Type:=xlDataLabelsShowLabelAndPercent, LegendKey _
:=True, HasLeaderLines:=True
ActiveChart.Location Where:=xlLocationAsObject, Name:="Feuil1"
ActiveSheet.Shapes(1).IncrementLeft -0.75
ActiveSheet.Shapes(1).IncrementTop 64.5
ActiveChart.HasLegend = False
'------------------------------------------------------------------
'tracer le graphe :  la production en montant de finacement selon le grade de risque "conso"
titre2 = "Production en montant par grade de risque 'conso'"
Set graph = Charts.Add
With graph
.ChartType = xlPie
.SetSourceData Source:=[Feuil9].Range("B15:F15,B17:F17"), PlotBy:=xlRows
.HasTitle = True
.ChartTitle.Characters.Text = titre2
.ChartTitle.Left = .ChartArea.Width
.ChartTitle.Left = .ChartTitle.Left / 10
decal = .ChartArea.Width / 2 - (.PlotArea.Left + .PlotArea.Width / 2)
.ChartTitle.Left = .ChartTitle.Left - decal
.ChartArea.Border.Weight = 2
.PlotArea.Top = 70
.PlotArea.Width = 350
.PlotArea.Height = 100
.PlotArea.Left = 250
.PlotArea.Top = 75
End With
ActiveChart.ApplyDataLabels Type:=xlDataLabelsShowLabelAndPercent, LegendKey _
:=True, HasLeaderLines:=True
ActiveChart.Location Where:=xlLocationAsObject, Name:="Feuil1"
ActiveSheet.Shapes(2).IncrementLeft 2#
ActiveSheet.Shapes(2).IncrementTop 12.75
ActiveChart.HasLegend = False
'------------------------------------------------------------------
'graphe: archivage des dossiers par grade de risque
titre3 = "Archivage des dossiers par grade de risque 'conso'"
Set graph = Charts.Add
'[Feuil9].Range("B15:F15,B19:F19,B18:F18").Select
 With graph
    .ChartType = xlColumnStacked
    .SetSourceData Source:=[Feuil9].Range("B15:F15,B18:F19"), PlotBy:=xlRows
    .HasTitle = True
    .ChartTitle.Characters.Text = titre3
    .SeriesCollection(1).Name = "=""dossiers  archivés"""
    .SeriesCollection(2).Name = "=""dossiers non archivés"""
    .HasAxis(xlCategory, xlPrimary) = True
    .HasAxis(xlValue, xlPrimary) = True
    .Axes(xlCategory, xlPrimary).CategoryType = xlAutomatic
.ChartTitle.Left = .ChartArea.Width
.ChartTitle.Left = .ChartTitle.Left / 2
decal = .ChartArea.Width / 2 - (.PlotArea.Left + .PlotArea.Width / 2)
.ChartTitle.Left = .ChartTitle.Left - decal
.ChartArea.Border.Weight = 2
.PlotArea.Top = 50
.PlotArea.Width = 350
.PlotArea.Height = 174
.PlotArea.Left = 100
.PlotArea.Top = 75
End With
      With ActiveChart.Axes(xlCategory)
        .HasMajorGridlines = False
        .HasMinorGridlines = False
    End With
    With ActiveChart.Axes(xlValue)
        .HasMajorGridlines = True
        .HasMinorGridlines = False
    End With
'ActiveChart.ApplyDataLabels Type:= xlDataLabelsShowLabelAndPercent, LegendKey _
':=True, HasLeaderLines:=True
ActiveChart.Location Where:=xlLocationAsObject, Name:="Feuil1"
ActiveSheet.Shapes(2).IncrementLeft -5.25
ActiveSheet.Shapes(2).IncrementTop 700.5
ActiveChart.HasLegend = False
'------------------------------------------------------------------
'centrer les titres
For Each co In ActiveSheet.ChartObjects
With co.Chart
.ChartArea.Border.Weight = 2
.ChartArea.Border.LineStyle = -1
.ChartArea.Interior.ColorIndex = 36
.PlotArea.Border.Weight = xlThin
.PlotArea.Border.LineStyle = xlNone
.PlotArea.Interior.ColorIndex = 36
.PlotArea.Interior.PatternColorIndex = 1
.PlotArea.Interior.Pattern = xlSolid
End With
Next
'------------------------------------------------------------------