WPF Charting Documentation - SciChart WPF Charts SDK v5.x
The SurfaceMesh 3D Chart Type

The surface mesh renders a two-dimensional array as a heightmap. The SurfaceMeshRenderableSeries3D type provides a number of configurable chart types in SciChart 3D, including:

 

Declaring a Surface Mesh with Uniform Data

To declare a Surface Mesh with uniform data, use the following code:

<s3D:SciChart3DSurface x:Name="sciChart" WorldDimensions="200,100,200" BorderThickness="0">
    <s3D:SciChart3DSurface.Camera>
        <s3D:Camera3D ZoomToFitOnAttach="True"/>
    </s3D:SciChart3DSurface.Camera>
    <s3D:SciChart3DSurface.RenderableSeries>
        <s3D:SurfaceMeshRenderableSeries3D x:Name="surfaceMeshRenderableSeries"
                                        DrawMeshAs="SolidWireFrame"
                                        Stroke="#77228B22"
                                        ContourStroke="#77228B22"
                                        StrokeThickness="2.0"
                                        DrawSkirt="False"
                                        Opacity="0.9">
           <s3D:SurfaceMeshRenderableSeries.MeshColorPalette>
              <s3D:GradientColorPalette>
                  <s3D:GradientColorPalette.GradientStops>
                     <GradientStop Offset="1" Color="DarkRed"/>
                     <GradientStop Offset="0.9" Color="Red"/>
                     <GradientStop Offset="0.7" Color="Yellow"/>
                     <GradientStop Offset="0.5" Color="GreenYellow"/>
                     <GradientStop Offset="0.3" Color="Cyan"/>
                     <GradientStop Offset="0.1" Color="Blue"/>
                     <GradientStop Offset="0.0" Color="#1D2C6B"/>
                  </s3D:GradientColorPalette.GradientStops>
              </s3D:GradientColorPalette>
           </s3D:SurfaceMeshRenderableSereis.MeshColorPalette>
        </s3D:SurfaceMeshRenderableSeries3D>
    </s3D:SciChart3DSurface.RenderableSeries>
    <s3D:SciChart3DSurface.XAxis>
        <s3D:NumericAxis3D />
    </s3D:SciChart3DSurface.XAxis>
    <s3D:SciChart3DSurface.YAxis>
        <s3D:NumericAxis3D VisibleRange="0,0.3"/>
    </s3D:SciChart3DSurface.YAxis>
    <s3D:SciChart3DSurface.ZAxis>
        <s3D:NumericAxis3D />
    </s3D:SciChart3DSurface.ZAxis>
</s3D:SciChart3DSurface>
int xSize = 25;
int zSize = 25;
var meshDataSeries = new UniformGridDataSeries3D<double>(xSize, zSize)
{
    StartX = 0,
    StepX = 1,
    StartZ = 0,
    StepZ = 1,
    SeriesName = "Uniform Surface Mesh",
};
for (int x = 0; x < xSize; x++)
{
    for (int z = 0; z < zSize; z++)
    {
        double xVal = ( double )x / ( double )xSize * 25.0;
        double zVal = ( double )z / ( double )zSize * 25.0;
        double y = Math.Sin(xVal * 0.2) / ((zVal+1) * 2);
        meshDataSeries[z, x] = y;
    }
}
surfaceMeshRenderableSeries.DataSeries = meshDataSeries;

 

Data is stored in the UniformGridDataSeries3D Type. This represents a 2-dimensional array of arrays (or 2D Jagged array) typically of type Double (but can be defined with generics).

 

Some important points to note:

 

 

 

See Also

 

 


SCICHART ® is a Registered Trademark in the UK, US and EEC. Copyright SciChart Ltd 2011-2018.

Email us to give feedback!