Page 1 of 1
updating data to a surface plot and having it display
Posted: Wed May 04, 2005 8:57 pm
by 8123236
OK, this should be simple, but I can't seem to get this to work. I want to plot data to a surface, then modify the data in my array, then replot it.
Why is this not working. The initial plot of data to the array works fine, but subsequent sending of data to the plot does nothing.
Im putting data to the plot by (Surface is my array of data):
Sub GraphMe()
Dim x, y As Int16
For x = -100 To 100
For y = -100 To 100
Surface1.Add(x, Surface(x + 100, y + 100), y)
Next
Next
End Sub
Any help is appreciated.
Matt
Posted: Thu May 05, 2005 9:28 am
by narcis
Hi Matt,
The code below works for me using TeeChart for .NET v2 BETA, available at our download area for all .NET customers. Could you please test if it works for you?
Code: Select all
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim x, z As Int16
Randomize()
For x = 0 To 10
For z = 0 To 10
Me.Surface1.Add(x, Rnd(100), z)
Next
Next
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim x, z As Int16
Randomize()
For x = 11 To 100
For z = 11 To 100
Surface1.Add(x, Rnd(100), z)
Next
Next
End Sub
If it doesn't work could you please send us an example we can run "as-is" to reproduce the problem here? You can post it at [url]news://
www.steema.net/steema.public.attachments[/url] newsgroup.
Posted: Thu May 05, 2005 1:03 pm
by 8123236
Your example does work... Does the subroutine have to terminate before the update occurs?
If I do this:
Dim x, z, k As Int16
For k = 1 To 10
Randomize()
For x = 11 To 100
For z = 11 To 100
Surface1.Add(x, Rnd(100), z)
Next
Next
Next
then there is no update until the k loop is complete. This is more akin to what I want to do.
--****
Ahh!! I found it! If I add:
TChart1.Refresh()
in the k loop then it redraws every time throught the loop.
--****
Edit: Well, that worked for the simple example anyway, but not for mine... not sure why. Maybe becasue it is a smaller data set?
Thanks,
Matt
Posted: Thu May 05, 2005 2:00 pm
by narcis
Hi Matt,
It's hard to guess without more information. Could you please send us an example we can run "as-is" to reproduce the problem here? You can post it [url]news://
www.steema.net/steema.public.attachments[/url] newsgroup.