How to set sfsurfacechart to square?



I'd like to show the chart in a sqaure shape (x and z axis have equal length)\
Please tell me what to do.

1 Reply 1 reply marked as answer

SS Sridevi Sivakumar Syncfusion Team May 12, 2021 02:28 PM UTC

Hi sungjin,

Greetings from Syncfusion.

We have analyzed your requirement and we can achieve it by setting the SurfaceChart RowSize and ColumnSize equally as per below code snippet.

[C#]:
 
     public MainWindow() 
        { 
            InitializeComponent(); 
           DataValues = new ObservableCollection<Data>(); 
                    double inc = 1.0 / 50; 
                    for (double x = 0; x < 1; x += inc) 
                    { 
                        for (double z = 0; z < 1; z += inc) 
                        { 
                            double y = Math.Sin((x - 0.5) * 2 * Math.PI) * Math.Sin((z - 0.5) * 2 * Math.PI); 
                            DataValues.Add(new Data() { X = x, Y = y, Z = z }); 
                        } 
                    } 
                    surface.RowSize = 50; 
                    surface.ColumnSize = 50; 
                    surface.ItemsSource = DataValues; 
         } 

Let us know if you need any further assistance.

Regards,
Sridevi S.
 
 


Marked as answer
Loader.
Up arrow icon