Problem with Surface serie and datasource Recordset
Posted: Mon Jun 19, 2006 12:34 pm
Hello
i am using activeX 5.0.5.0.
I have a simple chart with one surface serie.
I am trying to fill serie with datas from a recordset but it does'nt work.
So i made a little example with an unconnected recordset and the problem
is the same. I can't see datas in my serie. The X and Y axis are settings correctly, but there is no Z axis.
Code is below.
Thanks for your help.
Regards
Set rs_ado = New ADODB.Recordset
Dim tabX(2) As Double
Dim tabY(2, 2) As Double
Dim tabZ(2) As Double
Dim i As Long
rs_ado.Fields.Append "FieldX", adDouble
rs_ado.Fields.Append "FieldZ", adDouble
rs_ado.Fields.Append "FieldY", adDouble
tabX(0) = 1
tabX(1) = 2
tabX(2) = 3
tabZ(0) = 90
tabZ(1) = 95
tabZ(2) = 100
tabY(0, 0) = 15
tabY(0, 1) = 35
tabY(0, 2) = 20
tabY(1, 0) = 10
tabY(1, 1) = 15
tabY(1, 2) = 5
tabY(2, 0) = 45
tabY(2, 1) = 60
tabY(2, 2) = 55
rs_ado.Open
For i = 0 To 2
For j = 0 To 2
rs_ado.AddNew
rs_ado.Fields(0) = tabX(i)
rs_ado.Fields(1) = tabZ(i)
rs_ado.Fields(2) = tabY(i, j)
rs_ado.Update
Next
Next
TChart1.Series(0).DataSource = rs_ado
TChart1.Series(0).asSurface.ZValues.ValueSource = "FieldZ"
TChart1.Series(0).XValues.ValueSource = "FieldX"
TChart1.Series(0).YValues.ValueSource = "FieldY"
i am using activeX 5.0.5.0.
I have a simple chart with one surface serie.
I am trying to fill serie with datas from a recordset but it does'nt work.
So i made a little example with an unconnected recordset and the problem
is the same. I can't see datas in my serie. The X and Y axis are settings correctly, but there is no Z axis.
Code is below.
Thanks for your help.
Regards
Set rs_ado = New ADODB.Recordset
Dim tabX(2) As Double
Dim tabY(2, 2) As Double
Dim tabZ(2) As Double
Dim i As Long
rs_ado.Fields.Append "FieldX", adDouble
rs_ado.Fields.Append "FieldZ", adDouble
rs_ado.Fields.Append "FieldY", adDouble
tabX(0) = 1
tabX(1) = 2
tabX(2) = 3
tabZ(0) = 90
tabZ(1) = 95
tabZ(2) = 100
tabY(0, 0) = 15
tabY(0, 1) = 35
tabY(0, 2) = 20
tabY(1, 0) = 10
tabY(1, 1) = 15
tabY(1, 2) = 5
tabY(2, 0) = 45
tabY(2, 1) = 60
tabY(2, 2) = 55
rs_ado.Open
For i = 0 To 2
For j = 0 To 2
rs_ado.AddNew
rs_ado.Fields(0) = tabX(i)
rs_ado.Fields(1) = tabZ(i)
rs_ado.Fields(2) = tabY(i, j)
rs_ado.Update
Next
Next
TChart1.Series(0).DataSource = rs_ado
TChart1.Series(0).asSurface.ZValues.ValueSource = "FieldZ"
TChart1.Series(0).XValues.ValueSource = "FieldX"
TChart1.Series(0).YValues.ValueSource = "FieldY"