Page 1 of 1

Axes and ordering

Posted: Fri Apr 20, 2007 4:31 pm
by 8739068
We have a complex application that generates arrays of points. We are working on optimizing the generation algorithms, thus is it important for us to understand the best ways to populate arrays of doubles to be consumed by various Series Styles.

Can someone explain HOW the following scenarios will work for 3 dimensional charts such as Surface, Vector3D , & Points3D

(1) If your X and Z form a regular grid, do they also need to be sorted? If so, does it have to be a particular sort?

(2) If your X and Z form a regular grid, except that there are some missing points in that grid, will that cause problems?

(3) If your X and Z form a regular grid, except that there are some duplicate points (same X,Y,Z), will that cause problems?

(4) If your X and Z form a regular grid, except that there are some duplicate X-Z pairs, with slightly different Y's, will that cause problems?

Posted: Mon Apr 23, 2007 10:43 am
by 9348258
Hi Mikes

Question 1: It's indifferent how you add values X and Z, by default, will be sorted ascendingly.

Question 2: No, it will not cause problems. You can try to do a test, as below code:

Code: Select all

//surface1 in tChart1.
            //surface2 in tChart2.
            for (int i = 0; i < 4; i++)
                for (int j = 0; j < 4; j++)
                {
                    double d = rnd.NextDouble();
                    if (i != 2 & j != 3) surface1.Add(i, d, j);
                    surface2.Add(i, d, j);
                }
Questions 3 and 4: Always last Y value will be drawn, example:

Code: Select all

surface1.Add(0, 12, 0); //Now point[0,0] has value = 12
surface1.Add(0, 5, 0); //Now point[0,0] has value = 5

follow up question

Posted: Mon Apr 23, 2007 1:57 pm
by 8739068
Regarding your answer to Question #1, does this apply if we pass in arrays of doubles? We do not call Add(double, double). Instead we call Add(double[],double[]).

Posted: Tue Apr 24, 2007 8:44 am
by 9348258
Hi Mike

It doesn't matter how is the array sorted. Even you don't provide sorted values to the series they will be automatically sorted according to X and Z valuelists order property.