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 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142
| Set MonGraphe = ThisWorkbook.Charts.Add
MonGraphe.ChartType = xlLineMarkers
MonGraphe.Location xlLocationAsObject, "Template"
With Worksheets("Template").ChartObjects(1)
.Left = Worksheets("Template").Cells(3, 8).Left
.Top = Worksheets("Template").Cells(3, 8).Top
.Height = 804
.Width = 539
End With
With ActiveChart
.HasTitle = True
.Axes(xlCategory).HasTitle = True
.Axes(xlValue).HasTitle = True
Select Case compteur_page
Case Is = 2
.ChartTitle.Characters.Text = "Evolution des cours"
Case Is = 3
.ChartTitle.Characters.Text = "Evolution des rendements"
Case Is = 4
.ChartTitle.Characters.Text = "Evolution base 100"
End Select
.ChartTitle.Font.Name = "Arial Narrow"
.ChartTitle.Font.Bold = True
.ChartTitle.Font.Italic = True
.ChartTitle.Left = .ChartArea.Left
.ChartTitle.Font.Size = 15
.Axes(xlCategory).AxisTitle.Characters.Text = "Dates"
.Axes(xlCategory).AxisTitle.Font.Name = "Arial Narrow"
.Axes(xlCategory).AxisTitle.Font.Bold = True
.Axes(xlCategory).AxisTitle.Font.Italic = True
Select Case compteur_page
Case Is = 2
.Axes(xlValue).AxisTitle.Characters.Text = "Cours"
Case Is = 3
.Axes(xlValue).AxisTitle.Characters.Text = "Rendements"
Case Is = 4
.Axes(xlValue).AxisTitle.Characters.Text = "Cours base 100"
End Select
.Axes(xlValue).AxisTitle.Font.Name = "Arial Narrow"
.Axes(xlValue).AxisTitle.Font.Bold = True
.Axes(xlValue).AxisTitle.Font.Italic = True
.Axes(xlValue).HasMajorGridlines = True
.Axes(xlCategory).HasMajorGridlines = True
.Axes(xlValue).MajorGridlines.Border.LineStyle = xlDot
.Axes(xlCategory).MajorGridlines.Border.LineStyle = xlDot
.Axes(xlValue).TickLabels.Font.Name = "Arial Narrow"
.Axes(xlCategory).TickLabels.Font.Name = "Arial Narrow"
.Axes(xlCategory).TickLabels.NumberFormat = "d/m/yy;@"
If compteur_page = 3 Then
.Axes(xlCategory).TickLabelPosition = xlLow
End If
.Axes(xlValue).MinimumScaleIsAuto = True
.Axes(xlValue).MaximumScaleIsAuto = True
.Axes(xlValue, xlPrimary).AxisTitle.Font.Name = "Arial Narrow"
.Axes(xlValue, xlPrimary).TickLabels.Font.Name = "Arial Narrow"
.Axes(xlValue, xlPrimary).AxisTitle.Font.Bold = True
.Axes(xlValue, xlPrimary).AxisTitle.Font.Italic = True
.Legend.Font.Name = "Arial Narrow"
.Legend.Border.LineStyle = xlNone
.Legend.Position = xlLegendPositionBottom
.PlotArea.Interior.ColorIndex = 2
.PlotArea.Border.LineStyle = xlNone
.Legend.Left = 54
.Legend.Top = 691
.Legend.Position = xlLegendPositionBottom
.Legend.Font.Size = 5
.Axes(xlCategory).AxisTitle.Font.Size = 10
.Axes(xlCategory).TickLabels.Font.Size = 7
.Axes(xlValue).TickLabels.Font.Size = 7
.Axes(xlValue).AxisTitle.Font.Size = 10
.PlotArea.Left = 25
.PlotArea.Top = 50
.PlotArea.Height = 150
.PlotArea.Width = 550
color = 51
l = 0
For Each MesSeries In .SeriesCollection
If Tab_(l) = "CAC 40" And compteur_page = 2 And l <> 0 Then
MesSeries.AxisGroup = 2
MesSeries.Border.ColorIndex = 3
MesSeries.Border.Weight = xlThick
MesSeries.MarkerStyle = xlMarkerStyleSquare
MesSeries.MarkerBackgroundColorIndex = 3
MesSeries.MarkerForegroundColorIndex = 3
MesSeries.MarkerSize = 2
MesSeries.Name = Tab_(l)
.Axes(xlValue, xlSecondary).HasTitle = True
.Axes(xlValue, xlSecondary).AxisTitle.Characters.Text = "CAC 40"
.Axes(xlValue, xlSecondary).AxisTitle.Font.Name = "Arial Narrow"
.Axes(xlValue, xlSecondary).TickLabels.Font.Name = "Arial Narrow"
.Axes(xlValue, xlSecondary).AxisTitle.Font.Bold = True
.Axes(xlValue, xlSecondary).AxisTitle.Font.Italic = True
.Axes(xlValue, xlSecondary).TickLabels.Font.Size = 7
.Axes(xlValue, xlSecondary).AxisTitle.Font.Size = 10
Else
color = color - 1
If Tab_(l) = "CAC 40" Then
MesSeries.Border.ColorIndex = 3
MesSeries.Border.Weight = xlThick
MesSeries.MarkerStyle = xlMarkerStyleSquare
MesSeries.MarkerBackgroundColorIndex = 3
MesSeries.MarkerForegroundColorIndex = 3
MesSeries.MarkerSize = 2
Else
MesSeries.Border.ColorIndex = color
MesSeries.Border.Weight = xlThick
MesSeries.MarkerStyle = xlMarkerStyleSquare
MesSeries.MarkerBackgroundColorIndex = color
MesSeries.MarkerForegroundColorIndex = color
MesSeries.MarkerSize = 2
End If
MesSeries.Name = Tab_(l)
End If
l = l + 1
Next MesSeries
End With |
Partager