Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

Unexplained data on my Graph control

I've populated a graph control with approx. 900 data points. my graph looks fine except for an unexplained slope starting at 0,0.....and continuing on the diagonal through about -11, 1000.

I'm no mathematician, but this almost appears like a trend line. there are no coresponding data points in my source data. I am wondering if I have inadvertently set a property of the graph control?
0 Kudos
Message 1 of 5
(3,534 Views)
This may be a graphics error in the control. How are you ploting the data on the CWGraph? What version are you using?

Best Regards,

Chris Matthews
National Instruments
0 Kudos
Message 2 of 5
(3,534 Views)
Chris:

Thanks for the input. This is the first time I have used this control. I am plotting between 900 and 1000 points each time the process is run. I had Graph1.Numpoints set to 1000, and in this instance was plotting 900 points using a For...Next loop. My code looked like this:

Graph1.NumPoints = 1000
Graph1.NumSets = 2

For j = 1 To 900
Line Input #i, l
For k = 1 To Len(l)
p = k
If Mid$(l, k, 1) = Chr$(9) Then Exit
Next k
x = CDbl(Mid$(l, 1, p - 1))
y = CDbl(Mid$(l, p + 1))
If x < MinX Then
MinX = x
End If
If x < 1001 Then
If y < MinY Then
MinY = y

End If
End If
Graph1.ThisSet = 1
Graph1.Data(j) = y
Graph1.XPos(j) = x
Next j

It seems that the discrepancy between my Numpoints value, and the upper limit of j, caused my problem. As soon as I made sure that they were the same, my graph showed properly. If you know why this happens, I certainly could use a clue.

As I said, this is my first experience with the control, and I am sure that I could be coding this more efficiently, but I am happy for now.


Thanks again,

Alex
0 Kudos
Message 3 of 5
(3,534 Views)
It doesn't sound like you are using our CWGraph control. I've never worked with whatever graph control you are using. This is a Measurement Studio forum so I assumed you were using our CWGraph ActiveX control. Our control doesn't have any properties like the ones you are using. You should contact the developers of the Graph you are using with questions. See if your control has an About Box that tells you who made it.

Best Regards,

Chris Matthews
National Instruments
0 Kudos
Message 4 of 5
(3,534 Views)
From looking at the image you sent, I can tell this is not our CWGraph control (included in the Measurement Studio package). Are you sure this control is a National Instruments product?

Azucena
0 Kudos
Message 5 of 5
(3,534 Views)