Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
2510 connectés 

  FORUM HardWare.fr
  Programmation
  XML/XSL

   graph-lier axe/fond du graph

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

graph-lier axe/fond du graph

n°1918303
alexisbc
étudiant
Posté le 25-08-2009 à 20:10:27  profilanswer
 

Bonjour,  
 
Afin de faire un zoom correcte sur un graph nuage de point, je voulais savoir si qq connaissait un moyen de lier/ attacher le fond du graph (remplissage) aux axes. C a dire, lorsque je change d'échelle au niveau des axes le remplissage (plus ou moins zoomer) doit être différent....
 
Cf mon fichier
 
Merci d'avance  
 
Alexis
 
 
voici mon code pour changer l'échelle...
FOnunction TestPresenceGraph() As Boolean
' test la présence d'un objet dans ActiveGraph
TestPresenceGraph = False
If ActiveChart Is Nothing Then
MsgBox "Rien de sélectionné"
Else
TestPresenceGraph = True
End If
End Function
Sub ZoomBy2_ActivGraph()
'
' Macro enregistrée le 14/05/2007 par G4industri
'
Dim ValMin As Long
Dim ValMax As Long
Dim ValRange As Long
 
'Pour un programme entier il faudrait memoriser les valeurs Xmin, Xmax, Ymin, Ymax
'pour y revenir suite a une demande de RESET
 
' On controle qu'il y ait un graph a zoomer
If Not TestPresenceGraph Then Exit Sub
'
'On travail sur les ordonnees
ActiveChart.Axes(xlValue).Select
With ActiveChart.Axes(xlValue)
 
 
'on recupere les infos pour determiner l'amplitude
ValMin = .MinimumScale
ValMax = .MaximumScale
ValRange = ValMax - ValMin
 
'on modifie les valeurs de l'echelle
.MinimumScale = ValMin + ValRange / 4
.MaximumScale = ValMax - ValRange / 4
End With
 
'Puis sur les abscisses
ActiveChart.Axes(xlCategory).Select
With ActiveChart.Axes(xlCategory)
'on recupere les infos pour determiner l'amplitude
ValMin = .MinimumScale
ValMax = .MaximumScale
ValRange = ValMax - ValMin
 
'on modifie les valeurs de l'echelle
.MinimumScale = ValMin + ValRange / 4
.MaximumScale = ValMax - ValRange / 4
End With
 
 
 
 
End Sub
 
Sub UnZoomBy2_ActivGraph()
Dim ValMin As Long
Dim ValMax As Long
Dim ValRange As Long
 
' On controle qu'il y ait un graph a zoomer
If Not TestPresenceGraph Then Exit Sub
 
'On travail sur les ordonnees
ActiveChart.Axes(xlValue).Select
With ActiveChart.Axes(xlValue)
'on recupere les infos pour determiner l'amplitude
ValMin = .MinimumScale
ValMax = .MaximumScale
ValRange = ValMax - ValMin
 
'on modifie les valeurs de l'echelle
.MinimumScale = ValMin - ValRange / 4
.MaximumScale = ValMax + ValRange / 4
End With
 
 
 
 
 
 
'Puis sur les abscisses
ActiveChart.Axes(xlCategory).Select
With ActiveChart.Axes(xlCategory)
'on recupere les infos pour determiner l'amplitude
ValMin = .MinimumScale
ValMax = .MaximumScale
ValRange = ValMax - ValMin
 
'on modifie les valeurs de l'echelle
.MinimumScale = ValMin - ValRange / 4
.MaximumScale = ValMax + ValRange / 4
End With
End Sub
 
'Autres fonctionalités : le déplacement
Sub AllerVersDroite_ActivGraph()
 
Dim ValMin As Long
Dim ValMax As Long
Dim ValRange As Long
 
' On controle qu'il y ait un graph a zoomer
If Not TestPresenceGraph Then Exit Sub
'
 
 
 
'On ne touche pas les ordonnees
'ActiveChart.Axes(xlValue).Select
 
'Mais bien les abscisses
ActiveChart.Axes(xlCategory).Select
With ActiveChart.Axes(xlCategory)
'on recupere les infos pour determiner l'amplitude
ValMin = .MinimumScale
ValMax = .MaximumScale
ValRange = ValMax - ValMin
 
'on modifie les valeurs de l'echelle
.MinimumScale = ValMin + ValRange / 10
.MaximumScale = ValMax + ValRange / 10
End With
End Sub
 
 
 
 
 
 
 
 
 
 
 
Sub RESET()
Dim ValMin As Long
Dim ValMax As Long
Dim ValRange As Long
Dim Xmax As Long
Dim Ymax As Long
Dim Xmin As Long
Dim Ymin As Long
 
' On controle qu'il y ait un graph a zoomer
If Not TestPresenceGraph Then Exit Sub
 
Xmax = 40000
Xmin = 0
Ymax = 25000
Ymin = 0
 
'On travail sur les ordonnees
ActiveChart.Axes(xlValue).Select
With ActiveChart.Axes(xlValue)
 
'on modifie les valeurs de l'echelle
.MinimumScale = Ymin
.MaximumScale = Ymax
 
End With
 
'Puis sur les abscisses
ActiveChart.Axes(xlCategory).Select
With ActiveChart.Axes(xlCategory)
 
'on modifie les valeurs de l'echelle
.MinimumScale = Xmin
.MaximumScale = Ymax
End With
End Sub
 


---------------
merci pour tout...
mood
Publicité
Posté le 25-08-2009 à 20:10:27  profilanswer
 


Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  XML/XSL

   graph-lier axe/fond du graph

 

Sujets relatifs
Couleur de fond d'un div dans un div :/titre variable pour un graph
Répétition fond + méthodologie[JAVA] Définir une image de fond pour un JPanel
Faire un titre avec fond extensible[MFC] CTabCtrl problème de couleur de fond
Positionnement objet et image de fondPogrammer sur un fond dégradé
Fond qui se répètePb pour lier deux tables avec un pivot
Plus de sujets relatifs à : graph-lier axe/fond du graph


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR