Composants graphiques OWC11

cs_vallebarray Messages postés 2 Date d'inscription mercredi 28 mai 2008 Statut Membre Dernière intervention 28 avril 2009 - 27 avril 2009 à 17:33
cs_vallebarray Messages postés 2 Date d'inscription mercredi 28 mai 2008 Statut Membre Dernière intervention 28 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


End Sub

Le galérien      

1 réponse

cs_vallebarray Messages postés 2 Date d'inscription mercredi 28 mai 2008 Statut Membre Dernière intervention 28 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.

Le galérien
0
Rejoignez-nous