Graphe XY avec mschart??

dubail Messages postés 13 Date d'inscription jeudi 4 mai 2006 Statut Membre Dernière intervention 5 septembre 2006 - 20 juin 2006 à 17:42
sami_mkeche5 Messages postés 3 Date d'inscription jeudi 5 juillet 2007 Statut Membre Dernière intervention 6 septembre 2007 - 3 sept. 2007 à 11:14
Bonjour,

Est ce que quelqu'un aurait déjà réussi à créer des courbes en nuage de points avec les OWC11chart ?? Parce que j'y arrive très bien pour les courbes batons mais pas pour les XY. Je ne comprends vraiment pas pourquoi!

Merci
Eléonore 

9 réponses

cs_bipou Messages postés 61 Date d'inscription mercredi 14 janvier 2004 Statut Membre Dernière intervention 14 septembre 2006
21 juin 2006 à 11:31
oui avec les chartspace de OWC11.dll
quel est ton problème?
0
dubail Messages postés 13 Date d'inscription jeudi 4 mai 2006 Statut Membre Dernière intervention 5 septembre 2006
21 juin 2006 à 18:40
Je ne comprends pas pourquoi, mais mon graphe XY ne s'affiche pas. J'ai le cadre, les axes (calibrés comme je le veux) mais les points ne s'affichent pas.
J'ai bien vérifié que les données que j'entre ne soient pas nulles. Je te montre mon code résumé :

Dim chConstants As OWC11.ChSeries
Dim chtNewChart As OWC11.ChChart

Set chtNewChart = ChartSpace1.Charts.Add
Set chConstants = chtNewChart.SeriesCollection.Add
chtNewChart.Type = chChartTypeScatterMarkers

 For i = 1 To NbLigne
            asCategories(i - 1) = optm.Debit(i)
            aiValues(i - 1) = optm.Vitesse(i)
 Next

chConstants.SetData chDimXValues, chDataLiteral, asCategories
chConstants.SetData chDimYValues, chDataLiteral, aiValues

Merci déjà de m'avoir répondu!
0
cs_bipou Messages postés 61 Date d'inscription mercredi 14 janvier 2004 Statut Membre Dernière intervention 14 septembre 2006
22 juin 2006 à 15:44
exemple

Private Sub CommandButton1_Click()
Dim chConstants
Dim chtNewChart
Dim NOM(1)
Dim XV(40)
Dim YV(40)

NOM(0) = "TEST PH"

For i = 0 To 39
XV(i) = 2 * (i - 20)
YV(i) = courb(XV(i))
Next

Set chConstants = ChartSpace1.Constants

' Add a new chart to Chartspace1.
Set chtNewChart = ChartSpace1.Charts.Add

' Specify that the chart is a column chart.
chtNewChart.Type = chConstants.chChartTypeScatterLine

' Bind the chart to the arrays.
chtNewChart.SetData chConstants.chDimSeriesNames, chConstants.chDataLiteral, NOM
chtNewChart.SeriesCollection(0).SetData chConstants.chDimXValues, chConstants.chDataLiteral, XV
chtNewChart.SeriesCollection(0).SetData chConstants.chDimYValues, chConstants.chDataLiteral, YV
End Sub

Function courb(x)
courb = 3 * x ^ 3 - (15 * x + 30) ^ 2 + x - 105
End Function
0
dubail Messages postés 13 Date d'inscription jeudi 4 mai 2006 Statut Membre Dernière intervention 5 septembre 2006
22 juin 2006 à 17:47
Merci infiniment, ça marche enfin!!
0

Vous n’avez pas trouvé la réponse que vous recherchez ?

Posez votre question
dubail Messages postés 13 Date d'inscription jeudi 4 mai 2006 Statut Membre Dernière intervention 5 septembre 2006
27 juin 2006 à 10:31
rebonjour!
J ai un nouveau probleme avec les OWC.chChart.
Je construit un graphe à batons superposés et je ne parviens pas à normmer les séries correctement.
Quand j'utilise le code trouver dans l'aide : 
chtNewChart.SetData chDimSeriesNames, chDataLiteral, asNames  (où asNames est mon tableau de noms de séries), et que j'affiche la légende, la première série a bien le premier nom de mon tableau, mais les noms suivant sont affectées à des séries qui n'existent pas, et les séries qui restent n'ont pas de nom. Elles gardent leurs noms Serie2, Serie3...
Quelqu'un aurait une solution??
0
cs_bipou Messages postés 61 Date d'inscription mercredi 14 janvier 2004 Statut Membre Dernière intervention 14 septembre 2006
29 juin 2006 à 09:59
deuxième exemple

Private Sub CommandButton2_Click()
    Dim chConstants
    Dim chtNewChart
    Dim NSerie(5)
    Dim mois(12)
    Dim XV1(12)
    Dim XV2(12)
    Dim XV3(12)
    Dim XV4(12)
    Dim XV5(12)


    For i = 0 To 4
    NSerie(i) = "N° série " & i + 1
    Next


    For i = 0 To 11
    mois(i) = i + 1
    XV1(i) = Int(Rnd * 10)
    XV2(i) = Int(Rnd * 10)
    XV3(i) = Int(Rnd * 10)
    XV4(i) = Int(Rnd * 10)
    XV5(i) = Int(Rnd * 10)
    Next
   
    Set chConstants = ChartSpace1.Constants


    ' Add a new chart to Chartspace1.
    Set chtNewChart = ChartSpace1.Charts.Add


    chtNewChart.Type = chConstants.chChartTypeColumnStacked


    ' Bind the chart to the arrays.
    chtNewChart.SetData chConstants.chDimSeriesNames, chConstants.chDataLiteral, NSerie
    chtNewChart.SetData chConstants.chDimCategories, chConstants.chDataLiteral, mois
    chtNewChart.SeriesCollection(0).SetData chConstants.chDimValues, chConstants.chDataLiteral, XV1
    chtNewChart.SeriesCollection(1).SetData chConstants.chDimValues, chConstants.chDataLiteral, XV2
    chtNewChart.SeriesCollection(2).SetData chConstants.chDimValues, chConstants.chDataLiteral, XV3
    chtNewChart.SeriesCollection(3).SetData chConstants.chDimValues, chConstants.chDataLiteral, XV4
    chtNewChart.SeriesCollection(4).SetData chConstants.chDimValues, chConstants.chDataLiteral, XV5
End Sub
0
cs_bipou Messages postés 61 Date d'inscription mercredi 14 janvier 2004 Statut Membre Dernière intervention 14 septembre 2006
29 juin 2006 à 09:59
deuxième exemple

Private Sub CommandButton2_Click()
    Dim chConstants
    Dim chtNewChart
    Dim NSerie(5)
    Dim mois(12)
    Dim XV1(12)
    Dim XV2(12)
    Dim XV3(12)
    Dim XV4(12)
    Dim XV5(12)


    For i = 0 To 4
    NSerie(i) = "N° série " & i + 1
    Next


    For i = 0 To 11
    mois(i) = i + 1
    XV1(i) = Int(Rnd * 10)
    XV2(i) = Int(Rnd * 10)
    XV3(i) = Int(Rnd * 10)
    XV4(i) = Int(Rnd * 10)
    XV5(i) = Int(Rnd * 10)
    Next
   
    Set chConstants = ChartSpace1.Constants


    ' Add a new chart to Chartspace1.
    Set chtNewChart = ChartSpace1.Charts.Add


    chtNewChart.Type = chConstants.chChartTypeColumnStacked


    ' Bind the chart to the arrays.
    chtNewChart.SetData chConstants.chDimSeriesNames, chConstants.chDataLiteral, NSerie
    chtNewChart.SetData chConstants.chDimCategories, chConstants.chDataLiteral, mois
    chtNewChart.SeriesCollection(0).SetData chConstants.chDimValues, chConstants.chDataLiteral, XV1
    chtNewChart.SeriesCollection(1).SetData chConstants.chDimValues, chConstants.chDataLiteral, XV2
    chtNewChart.SeriesCollection(2).SetData chConstants.chDimValues, chConstants.chDataLiteral, XV3
    chtNewChart.SeriesCollection(3).SetData chConstants.chDimValues, chConstants.chDataLiteral, XV4
    chtNewChart.SeriesCollection(4).SetData chConstants.chDimValues, chConstants.chDataLiteral, XV5
End Sub
0
cf38 Messages postés 4 Date d'inscription dimanche 17 avril 2005 Statut Membre Dernière intervention 1 octobre 2007
19 sept. 2006 à 12:08
En ce qui concerne la courbe qui ne s'affiche pas:
- j'avais déclaré les tableaux X et Y de données  as double. Après les avoirs déclaré en as variant, Oh miracle, la courbe s'est affichée.
- Une première erreur de programmation m'avait généré des comportements anormaux:
Je n'avais pas déclaré correctement chConstants: 
chConstants = Graphique1.Constants
De ce fait, toutes les constantes graphiques étaient nulles.
Set chConstants = Graphique1.Constants marche mieux

Le Pied ..... en informatique.(à interpréter dans le sens que tu souhaites)
0
sami_mkeche5 Messages postés 3 Date d'inscription jeudi 5 juillet 2007 Statut Membre Dernière intervention 6 septembre 2007
3 sept. 2007 à 11:14
bonjour,
j'ai un tablaeu qui contient les f(x) et un autre tableau qui contient les x de l'axe des abscisse, j'ai utilise mschart mais j'arrive pas a tracer la courbe, comment je doit faire.
qui peut m'aider?
0
Rejoignez-nous