How to correctly draw a Surface

I am trying to draw a Surface as in the attached figure 1.

The following is a snippet of code that adds these points. 

Ultimately, I want to get the effect as in the Picture marked with the symbol 2

Unfortunately, something like this arises in the program. Strange shapes merging at zero point

      



            var test = new List<DataSurface>();

            test.Add(new DataSurface() { X = 0, Z = 400, Y = 0 });

            test.Add(new DataSurface() { X = 20, Z = 350, Y = 0 });

            test.Add(new DataSurface() { X = 150, Z = 150, Y = 0 });

            test.Add(new DataSurface() { X = 240, Z = 70, Y = 0 });

            test.Add(new DataSurface() { X = 300, Z = 0, Y = 0 });


            test.Add(new DataSurface() { X = 0, Z = 400, Y = 50 });

            test.Add(new DataSurface() { X = 20, Z = 350, Y = 50 });

            test.Add(new DataSurface() { X = 150, Z = 150, Y = 50 });

            test.Add(new DataSurface() { X = 240, Z = 70, Y = 50 });

            test.Add(new DataSurface() { X = 300, Z = 0, Y = 50 });


            RowSize = 4;

            ColumnSize = 4;


            DataSurfaceValues = new ObservableCollection<DataSurface>(test);




1 Reply

RS Ragul Subramani Syncfusion Team December 10, 2021 12:53 PM UTC

Hi Bartlomiej,


Greetings from Syncfusion.


In surface chart, you can apply data in a grid table format, that contains the number of rows and columns as shown in the following table.


Z0

Z1

Z2

Zn

X1

Y00

Y01

Y02

Y0n

X1

Y10

Y11

Y12

Y1n

X2

Y20

Y21

Y22

Y2n

Xn

Yn0

Yn1

Yn2

Ynn


We have checked your query and we would like to inform you that, you are using the 2 rows and 5 columns as per your data values. But you have defined it as 4 rows and 4 columns which caused the issue. You can declare the row size as 2 and column size as 5 which will fix your issue.


Regards,

Ragul S V


Loader.
Up arrow icon