Bonjour,
Voilà mon pb,
J'utilise le graphique de Office Web Components pour .... faire un graphique, mais voilà tant que je n'utilise qu'un axe tout va bien, mais dès que je veux affecter par exemple une courbe sur l'axer secondaire je bloque :
Voici une partie de mon code, si qlqu'un sait comment affecter une série de donner à un axe ???
' Variable
' -----------------------------------------------------------
Dim Cspace As ChartSpace
Dim Cchart As WCChart
Dim rsd As RecordsetDef
Dim CSérie As WCSeries
Dim Caxis As WCAxis
' Connextion à la source de données
' --------------------------------------------------------------
strsql = "Select ......... From ........."
DataSourceControl1.ConnectionString = _
"DRIVER={Microsoft Access Driver (*.mdb)}; " & _
"DBQ=" & CurrentDb.Name
Set rsd = DataSourceControl1.RecordsetDefs.AddNew( _
StrSql, 3)
' Initialisation du graph
' -------------------------------------------------------------
Set Cspace = Me.Graph1.Object
With Cspace
.Clear
.Refresh
.DataSource = Me.DataSourceControl1.Object
.DataMember = rsd.Name
End With
' Création du graphique
' ----------------------------------------------------------------
Set Cchart = Cspace.Charts.Add
With Cchart
.HasLegend = True
.HasTitle = True
' Paramétre l'axe principal
With .Axes(0)
.Scaling.HasAutoMaximum = True
.Scaling.Minimum = 0
End With
' Création axe secondaire
With .Axes.Add(.Scalings(chDimValues), chAxisPositionRight, chValueAxis)
.Scaling.HasAutoMaximum = True
.Scaling.Minimum = 0
End With
End With
' Création de la série 1
Set CSérie = Cchart.SeriesCollection.Add
With CSérie
.Type = chChartTypeLineMarkers
.Caption = "RENDEMENT"
.SetData chDimCategories, 0, 0
.SetData chDimValues, 0, "WK01_REND"
With .DataLabelsCollection.Add
.HasValue = True
.NumberFormat = "0,0%"
End With
End With
' Création de la série 2
Set CSérie = Cchart.SeriesCollection.Add
With CSérie
.Type = chChartTypeLineMarkers
.Caption = "ARRET"
.SetData chDimCategories, 0, 0
.SetData chDimValues, 0, "WKC01_1"
With .DataLabelsCollection.Add
.HasValue = True
.NumberFormat = "0,0"
End With
End With
merci
Stef
"Si ton labeur est dur et si tes résultats sont minces, rappelles toi qu'un jour le grand chêne a été un gland comme toi."