SciChart WPF 3D Charts > Tutorials > Code-Behind > Tutorial 02-3D - Creating a SciChart3DSurface
Tutorial 02-3D - Creating a SciChart3DSurface

The SciChart3DSurface Type

The root 3D chart control is called the SciChart3DSurface and provides a high performance DirectX powered 3D chart surface. This is the WPF Control you will be adding to your applications wherever you need a 3D chart. You can add more than one SciChart3DSurface and configure them independently.

Source code for this tutorial can be found at our SciChart.WPF.Examples Github Repository under Tutorials section.

Declaring a SciChart3DSurface Instance

After referencing the SciChart 3D DLLs from NuGet (package: SciChart3D), from local DLL files (referencing DLLs SciChart.Core, SciChart.Data, SciChart.Drawing, SciChart.Charting and SciChart.Charting3D) or the SciChart 3D Source from GitHub, a SciChart3DSurface instance can be declared as follows:

Declaring a SciChart3DSurface Instance in XAML
Copy Code
<Window x:Class="Tutorial_02_Creating_a_SciChart3DSurface.MainWindow"
        Title="Tutorial 02 - Creating a SciChart3DSurface"

        <!--  Create the chart surface  -->
        <!--  where xmlns:s3D=""  -->
        <s3D:SciChart3DSurface x:Name="sciChart3DSurface">
            <!--  Create an X Axis  -->
                <s3D:NumericAxis3D AxisTitle="X-Axis 3D"/>
            <!--  Create a Y Axis  -->
                <s3D:NumericAxis3D AxisTitle="Y-Axis 3D"/>
            <!--  Create a Z Axis  -->
                <s3D:NumericAxis3D AxisTitle="Z-Axis 3D"/>
            <!--  Specify interactivity modifiers  -->
Declaring a SciChart3DSurface Instance in Code
Copy Code
// Create the chart surface
var sciChart3DSurface = new SciChart3DSurface();

// Create the X, Y and Z axes
var xAxis = new NumericAxis3D { AxisTitle = "X-Axis 3D" };
var yAxis = new NumericAxis3D { AxisTitle = "Y-Axis 3D" };
var zAxis = new NumericAxis3D { AxisTitle = "Z-Axis 3D" };

sciChart3DSurface.XAxis = xAxis;
sciChart3DSurface.YAxis = yAxis;
sciChart3DSurface.ZAxis = zAxis;

// Specify Interactivity Modifiers
sciChart3DSurface.ChartModifier = new ModifierGroup3D(
new OrbitModifier3D(), new ZoomExtentsModifier3D()); 

The above code declares a SciChart3DSurface, adds numeric X, Y and Z axes, adds orbit (rotation around camera target) and zoom behaviors. If you declared it in XAML, you should be able to see it in the WPF Designer.

Congratulations, you have just created your first SciChart3DSurface!

See Also