cs_vallebarray
Messages postés2Date d'inscriptionmercredi 28 mai 2008StatutMembreDernière intervention28 avril 2009
-
27 avril 2009 à 17:33
cs_vallebarray
Messages postés2Date d'inscriptionmercredi 28 mai 2008StatutMembreDernière intervention28 avril 2009
-
28 avril 2009 à 09:28
Bonjour à tous,
Malgré un zapping acharné sur l'aide en ligne et sur le site, je n'arrive pas à obtenir un simple graphe XY alors que les graphiques en histogramme se font sans problème. De guerre lasse, je vous laisse mon code et j'espère que l'un de vous me livrera la solution.
Private Sub CommandButton1_Click()
Dim chConstants
Dim chtNewChart
Dim Nom(1): Dim XV(40) As Variant: Dim YV(40) As Variant
Nom(0) = "Livres"
For i = 0 To 39
XV(i) = Range(Cells(2 + i, 7), Cells(2 + i, 7)).Value
YV(i) = Range(Cells(2 + i, 8), Cells(2 + i, 8)).Value
Next i
Set chConstants = ChartSpace1.Constants
Set chtNewChart = ChartSpace1.Charts.Add
Set ChartSpace1.DataSource = Feuil1
chtNewChart.Type = chConstants.chChartTypeScatterLine
chtNewChart.SetData chConstants.chDimSeriesNames, chConstants.chDataLiteral, Nom
chtNewChart.SeriesCollection(0).SetData chConstants.chDimValues, chConstants.chDataBound, XV chtNewChart.SeriesCollection(0).SetData chConstants.chDimValues, chConstants.chDataBound, YV
cs_vallebarray
Messages postés2Date d'inscriptionmercredi 28 mai 2008StatutMembreDernière intervention28 avril 2009 28 avril 2009 à 09:28
Ne bougez plus, une bête erreur de syntaxe (comme d'habitude...), j'avais omis de préciser respectivement chDimXYValues.
Merci tout de même à ceux qui ont lu mes bêtises.