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
| Public Sub TextZone(k%, ZoneName$, texte$, x1!, y1!, x2!, y2!, Optional couleur%)
Dim XX0!, YY0!, l!, LL!, h!, HH!
Dim XX1!, YY1!, DX!, DY!
XX0 = ActiveChart.PlotArea.InsideLeft
YY0 = ActiveChart.PlotArea.InsideTop
HH = ActiveChart.PlotArea.InsideHeight
LL = ActiveChart.PlotArea.InsideWidth
If (IPRESENT = 1 Or IPRESENT = 10) Then
If reponse <> "non" Then
h = Qmax(k) - Qmin(k)
l = Umax(k) - Umin(k)
XX1 = XX0 + (x1 - Umin(k)) * LL / l
YY1 = YY0 + (Qmax(k) - y1) * HH / h
Else
h = Umax(k) - Umin(k)
l = Qmax(k) - Qmin(k)
XX1 = XX0 + (Qmax(k) - x1) * LL / l
YY1 = YY0 + (y1 - Umin(k)) * HH / h
End If
Else
If reponse = "non" Then
h = Qmax(k) - Qmin(k)
l = Umax(k) - Umin(k)
XX1 = XX0 + (x1 - Umin(k)) * LL / l
YY1 = YY0 + (Qmax(k) - y1) * HH / h
Else
h = Umax(k) - Umin(k)
l = Qmax(k) - Qmin(k)
XX1 = XX0 + (Qmax(k) - x1) * LL / l
YY1 = YY0 + (y1 - Umin(k)) * HH / h
End If
' End If
End If
DX = (x2 - x1) * LL / l
DY = (y1 - y2) * HH / h
' fin de modification 003-D
'Form1.Text4.Text = XX0 & "-" & YY0 & "-" & HH & "-" & LL & "-" & h & "-" _
& l & "-" & XX1 & "-" & YY1
With ActiveChart
Set pa = .PlotArea
With .Shapes.AddTextbox(msoTextOrientationHorizontal, XX1, YY1, DX, DY)
' .TextFrame.Characters.Font.Name = "Arial Narrow"
.TextFrame.Characters.Font.ColorIndex = couleur
.TextFrame.Characters.Text = texte$
.TextFrame.HorizontalAlignment = xlLeft
.TextFrame.VerticalAlignment = xlTop
.TextFrame.Characters.Font.Size = 9 '8
.TextFrame.AutoSize = True
.Name = ZoneName$
End With
End With
End Sub |
Partager