updating data to a surface plot and having it display

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Matt G
Newbie
Newbie
Posts: 8
Joined: Fri Dec 12, 2003 5:00 am
Location: USA

updating data to a surface plot and having it display

Post by Matt G » Wed May 04, 2005 8:57 pm

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

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Thu May 05, 2005 9:28 am

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.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Matt G
Newbie
Newbie
Posts: 8
Joined: Fri Dec 12, 2003 5:00 am
Location: USA

Post by Matt G » Thu May 05, 2005 1:03 pm

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

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Thu May 05, 2005 2:00 pm

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.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply