Problem with Contour Series
Posted: Tue Jan 08, 2008 6:43 pm
The following code display nothing. What's wrong?
xz.csv:
Code: Select all
TChart1.ClearChart
TChart1.AddSeries (scContour)
'Read the data
Set oFs = New FileSystemObject
Dim oTs As TextStream
Set oTs = oFs.OpenTextFile(App.Path & "\xz.csv", ForReading)
oTs.ReadLine
Dim x() As Double
Dim y() As Double
Dim z() As Double
Dim aSplit
Dim sBuf As String
Dim nRec as long
nRec = -1
Do While Not oTs.AtEndOfStream
nRec = nRec + 1
sBuf = Trim(oTs.ReadLine)
If Len(sBuf) = 0 Then
Exit Do
End If
aSplit = Split(sBuf, ",")
ReDim Preserve x(nRec)
ReDim Preserve y(nRec)
ReDim Preserve z(nRec)
x(nRec) = aSplit(0)
y(nRec) = aSplit(1)
z(nRec) = aSplit(2)
Loop
TChart1.Aspect.View3D = False
TChart1.Series(0).asContour.AddArrayXYZ x, y, z
Code: Select all
X,Y,Z
683077.286,0,248002.373
683099.6342,-0.0011999999987893,248011.7774
683103.8526,-0.0019000000029337,248023.5668
683132.132,0,248033.965
683136.6297,0.0015999999886844,248040.5467
683138.0343,0.0023000000219326,248031.9636
683138.1388,0.0019000000029337,248032.3171
683142.4509,0.0027000000118278,248029.6065
683144.2054,0.0033999999868684,248029.1596
683145.8092,0.0022999999928288,248028.3265
683149.6297,-0.00039999998989515,248072.251
683150.6615,0.0021000000124332,248027.1327
683150.7757,0.0035999999963678,248027.4776
683154.8875,0.0025999999779742,248025.5205
683154.9848,0.0033999999868684,248025.8672
683159.2712,0.0017999999981839,248023.1736
683161.0311,0.0025000000023283,248022.7175
683162.6013,0.00090000001364388,248021.8975
683165.1154,0,248065.881
683165.7058,-0.00020000000949949,248065.6626
683167.4731,0.0010999999940395,248020.7049
683167.5882,0.0015999999886844,248021.0252
683171.6762,0.0007999999797903,248019.0994
683171.7962,0.0016999999934342,248019.4108
683176.0729,0.00089999998454005,248016.7552
683177.8114,0.0010999999940395,248016.2874
683179.4245,-0.001300000003539,248015.4726
683184.2872,0.0014000000082888,248014.2801
683184.3901,0.00070000000414439,248014.5887
683186.1029,0,248057.8044
683186.7446,9.9999975645915E-5,248057.5566
683188.487,0.00070000000414439,248012.6722
683188.5867,0.0016000000177883,248012.9852
683192.8981,0.00039999998989515,248010.3216
683194.6241,0.00090000001364388,248009.8533
683196.247,0.0014000000082888,248009.0429
683201.1585,0.00090000001364388,248008.044
683201.1941,0.00039999998989515,248008.1503
683205.308,0.00059999999939464,248006.2445
683205.4041,0.0022000000171829,248006.5365
683209.7049,0.0010999999940395,248003.8976
683211.4429,0.0026000000070781,248003.4093
683213.0697,0.0010999999940395,248002.6157
683215.5662,0,248046.5687
683216.1651,0,248046.3413
683217.9189,0.00059999999939464,248001.4235
683218.0206,0.0023999999975786,248001.7411
683222.124,0.0010999999940395,247999.8119
683222.2492,0.0026000000070781,248000.1227
683226.5309,0.0014000000082888,247997.4624
683228.2729,0.0022000000171829,247997.0066
683229.8863,0.0016999999934342,247996.1792
683234.7205,0.0013999999791849,247994.9923
683234.8442,0.0025000000023283,247995.3094
683238.9383,0.0011000000231434,247993.3821
683239.0606,0.0023999999975786,247993.692
683243.3324,0.001300000003539,247991.0295
683245.0971,0.0022999999928288,247990.5352
683246.6727,0.0018999999738298,247989.757
683251.579,0.001700000022538,247988.5899
683251.6928,0.0028999999922235,247988.8676
683255.8469,0.0019000000029337,247993.5207
683266.0892,0,248027.2417
683266.5974,-0.00019999998039566,248027.0483