Graph a partir d'un tableau

76cacash Messages postés 22 Date d'inscription mercredi 21 juin 2006 Statut Membre Dernière intervention 24 août 2006 - 1 août 2006 à 13:54
cs_GeorgesDeLajungle Messages postés 29 Date d'inscription lundi 22 mars 2004 Statut Membre Dernière intervention 22 juin 2007 - 29 sept. 2006 à 15:18
Salut,
j'ai récupérer des points dans un tableau et je voudrai les afficher grace au grap excel (avec le graph nuage de points)

1 réponse

cs_GeorgesDeLajungle Messages postés 29 Date d'inscription lundi 22 mars 2004 Statut Membre Dernière intervention 22 juin 2007 1
29 sept. 2006 à 15:18
Si tu le programme en .Net voici ce qu'il faut faire :
Intègre la librairie Excel à ton projet puis

        Dim excelapp As New Excel.Application

        excelapp.Workbooks.Open("c:\tableau.xls")
        excelapp.Visible = True

        excelapp.Charts.Add()
' Ajoute un graphe au fichier excel
        excelapp.ActiveChart.ChartType = Excel.XlChartType.xlXYScatter
'Défini le type de graphe en nuage de points
        excelapp.ActiveChart.SetSourceData(Source:=excelapp.Sheets("Feuil1").Range("A1:C3"), PlotBy:=Excel.XlRowCol.xlRows)
'Défini la plage de sélection des coordonnées
        excelapp.ActiveChart.Location(Where:=Excel.XlChartLocation.xlLocationAsObject, Name:="Feuil1")
'Défini où doit se positionner ton graphe sur ton document excel
        excelapp.ActiveChart.HasTitle = False
'Défini le titre de ton graphe
        excelapp.ActiveChart.Axes(Excel.XlAxisType.xlCategory, Excel.XlAxisGroup.xlPrimary).hastitle = False
'Défini le titre des axes horizontaux et verticaux
        excelapp.ActiveChart.Axes(Excel.XlAxisType.xlValue, Excel.XlAxisGroup.xlPrimary).hastitle = False

Eric
0
Rejoignez-nous