Page 1 of 1

Data will plot as 3d points but not as 3d surface

Posted: Wed Jul 26, 2006 8:43 pm
by 8119969
In 3d surface the surface plot does not display but if I turn the markers on the marks do display just not the plot.

John Lott

Posted: Thu Jul 27, 2006 8:23 am
by narcis
Hi John Lott,

Could you please send some code or an example we can run "as-is" to reproduce the problem here?

You can post your files at news://www.steema.net/steema.public.attachments newsgroup.

Thanks in advance.

Posted: Thu Jul 27, 2006 2:46 pm
by narcis
Hi John,

Thank you very much for the project.

Using your project with latest TeeChart for .NET v2 release, the series is populated and visible as you can see in the image I attached in the newsgroups.

Surface series and all series styles derived from Custom3D class need to have a grid structure. The grid's columns are determined by x values, rows by z values and each cell value is indicated by y values. If x and z values are not equidistant then you need to set IrregularGrid property to true. That's why not all points may be displayed in your surface series.

According to this, for your series to display all points, should be populated like this:

Code: Select all

        Dim s As Steema.TeeChart.Styles.Surface
        Dim x As Integer
        Dim z As Integer
        Dim Rand As New Random

        s = TChart1.Series(0)
        s.Clear()

        For x = 0 To 150
            For z = 1 To 12
                s.Add(3937 * x, Rand.Next(), z)
            Next z
        Next x

        s.IrregularGrid = True

Posted: Thu Jul 27, 2006 4:05 pm
by 8119969
Thanks for looking at my code.

I am unable to find the picture you spoke of.

Could you send me the code with any changes you made to it.

John

Posted: Fri Jul 28, 2006 7:45 am
by narcis
Hi John,

I didn't make any changes to the code. I just ran your project with TeeChart for .NET v2 latest maintenance release available at the customer download area.

I attached the picture in a message at the news://www.steema.net/steema.public.attachments newsgroup as a reply to the message with the attached project you sent. If necessary I can send the image to your forums contact e-mail address.

3d surface

Posted: Fri Jul 28, 2006 1:22 pm
by 8119969
Since my code works okay in teechart version 2.0 and I assume vsnet 2005, does that mean the problem lies in teechart version 1.1*** or vsnet 2003.

I did down load and install the latest 1.1 update.

What I am understanding is that my code is okay but it doesnot work in the environment I am using it.

John

Posted: Fri Jul 28, 2006 2:13 pm
by narcis
Hi John,

Your surface is not displayed at all using TeeChart for .NET v1. TeeChart for .NET v2 adds many enhancements and new features compared to TeeChart for .NET v1. However, with v2, your surface is still not fully drawn as it doesn't respect the grid structure I told you.

For example, the last row in your points.txt file is:

606.299,-10.744,12

606.299 is not a multiple of 3.937. Most of the x values are multiples of 3.937 but others not. This makes your data not to fit in this grid structure and thus those points won't be drawn.

3d surface

Posted: Fri Jul 28, 2006 2:19 pm
by 8119969
What does the value 3.937 mean ?

Posted: Fri Jul 28, 2006 2:32 pm
by narcis
Hi John,

If you look at your data file (this is just an excerpt):
0,-5.035004,1
19.685,-6.216003,1
23.622,-5.586006,1
27.559,-10.035,1
39.37,-9.523003,1
47.244,-17.51501,1
86.614,-33.736,1
94.488,-33.42101,1
98.425,-31.492,1
118.11,-40.58601,1
125.984,-44.051,1
129.921,-43.342,1
330.709,-45.62601,1
334.646,-51.728,1
342.52,-33.854,1
354.331,-18.145,1
366.142,-11.29501,1
370.079,-16.216,1
377.953,-5.744003,1
381.89,-7.555,1
429.134,0,1
440.945,-2.200005,1
460.63,0,1
0,-6.728004,2
3.937,-27.00401,2
7.874,-7.004005,2
11.811,-7.161003,2
19.685,-7.673004,2
23.622,-8.224007,2
35.433,-7.673004,2
47.244,-8.618004,2
51.181,-12.00401,2
55.118,-14.051,2
59.055,-10.11401,2
62.992,-16.80701,2
70.866,-22.673,2
78.74,-22.94901,2
82.677,-29.917,2
90.551,-26.846,2
98.425,-30.429,2
102.362,-31.413,2
106.299,-35.271,2
118.11,-38.539,2
157.48,-56.88601,2
342.52,-56.098,2
354.331,-31.964,2
358.268,-30.311,2
366.142,-25.62601,2
393.701,-5.035004,2
401.575,-6.295006,2
405.512,-6.137001,2
417.323,-0.1930008,2
496.063,0,2
574.803,-0.6650009,2
582.677,0,2
586.614,0,2
594.488,0,2
614.173,0,2
Most X values are multiple of 3.937:
  • 0 is obviously a multiple of 3.937
    19.685 = 3.937 * 5
    23.622 = 3.937 * 6
    27.559 = 3.937 * 7
    etc.
If all x values where multiples of 3.937 your data would fit in an IrregularGridded surface series. However as some of those x values are not multiples of 3.937 your data won't be properly populated in a surface series.

Claraification

Posted: Fri Jul 28, 2006 6:20 pm
by 8119969
The original values were in meters and were converted to inches.

In the example of 19.85 = 3.937 * 5

actually is .5 meters * 39.37 = 19.85 inches app.

My thinking now is that
a. my x's need to be integers or least something with a common divisor
b. my grid needs to 650 * 12 which would require a lot of points to draw a good plot.
c. As I only have about 500 points these are not sufficient to draw a good surface plot.

At any rate thanks for your help. I will see if I can come up with an alternative.

John

Posted: Mon Jul 31, 2006 7:24 am
by narcis
Hi John,

a. X values don't need to be integers, they can be doubles but they need to have a common divisor.
b. Well, this can make the surface being somewhat slow. This will depend on the power of the machine you are running the application at.
c. This depends on how your data is.