User interaction in WPF Surface Chart (SfSurfaceChart)

18 Aug 20213 minutes to read

The essential surface chart allows you to zoom and rotate the chart for a better visualization of all the axis and their points.

Zooming

Zooming of the surface chart is controlled with the help of EnableZooming property.

The following code shows how to enable zooming on surface chart.

<chart:SfSurfaceChart EnableZooming="True" >
    </chart:SfSurfaceChart>
SfSurfaceChart chart = new SfSurfaceChart();
            chart.EnableZooming = true;           
            grid.Children.Add(chart);

Zooming can either be done with pinch zooming or by programmatically with the ZoomLevel property.

<chart:SfSurfaceChart EnableZooming="True" ZoomLevel="0.5">
    </chart:SfSurfaceChart>
SfSurfaceChart chart = new SfSurfaceChart();
            chart.EnableZooming = true; 
            chart.ZoomLevel = 0.5;
            grid.Children.Add(chart);

Zoom level

Rotation

Surface chart can be rotated for better visualization of all the axis and their plots.

This can be controlled with the help of EnableRotation property.

<chart:SfSurfaceChart EnableRotation="True">
    </chart:SfSurfaceChart>
SfSurfaceChart chart = new SfSurfaceChart();
            chart.EnableRotation = true; 
            grid.Children.Add(chart);

Rotation can either be done with interaction or by programmatically using Rotate property.

<chart:SfSurfaceChart EnableRotation="True" Rotate="50">
    </chart:SfSurfaceChart>
SfSurfaceChart chart = new SfSurfaceChart();
            chart.EnableRotation = true; 
            chart.Rotate = 50;
            grid.Children.Add(chart);

Zoom level

Tilt

Surface chart can be tilted to a certain angle using the Tilt property.

<chart:SfSurfaceChart  Tilt="40">
    </chart:SfSurfaceChart>
SfSurfaceChart chart = new SfSurfaceChart();
            chart.Tilt = 40;
            grid.Children.Add(chart);

Zoom level