Have a problem with 3d surface plot in .net 2003

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
John Lott
Newbie
Newbie
Posts: 14
Joined: Tue Apr 08, 2003 4:00 am

Have a problem with 3d surface plot in .net 2003

Post by John Lott » Wed Jul 26, 2006 2:31 pm

I add a chart

add a 3d surface plot

in a button click event

I process the following code

Dim a As Integer
Dim b As Integer
Dim c As Integer
For a = 0 To 9
For b = 0 To 9
For c = 0 To 9
TChart1.Series(0).Add(a, b, c)
Next
Next
Next

I get no plot. I made no changes to the chart other than adding a 3d surface series.

any ideas what I am doing wrong

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

Post by Narcís » Wed Jul 26, 2006 3:06 pm

Hi John,

This is because you should type cast the series so that an Add(X,Y,Z) method for surface series is recognised.

However, please notice that surface series need to have a grid structure where columns are defined by x values, rows by z values and each cell value is defined by y values. If x and z values are not equidistant you should also set the IrregularGrid property to true. According to this the working code could be something like this:

Code: Select all

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim a As Integer
        'Dim b As Integer
        Dim c As Integer

        Dim b As New Random

        For a = 0 To 9
            'For b = 0 To 9
            For c = 0 To 9
                Surface1.Add(a, b.Next(), c)

                'or
                'CType(TChart1.Series(0), Steema.TeeChart.Styles.Surface).Add(a, b.Next(), c)
            Next
            'Next
        Next
    End Sub
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