Customizing Cartesian Chart 3D Series
The 3D series allows you to change the default appearance of their data point visuals. You can define a custom Material (texture) or a custom shape that is described by a MeshGeometry3D object.
You can find more information about 3D materials and geometries in the 3D Graphics Overview MSDN article.
Defining a custom material
The material of a 3D object specifies the brush or the texture that will be applied to it. You can set the material of the series’ data points via the DefaultVisualMaterial property which is of type System.Windows.Media.Media3D.Material. You can use any of the material types provided by the WPF framework.
Example 1: Setting default visual material
Figure 1: BarSeries3D and PointSeries3D with custom material
Defining a custom geometry
The geometry of a 3D object describes its shape. You can define a geometry for the series’ data points via the DefaultVisualGeometry property. The property is of type System.Windows.Media.Media3D.Geometry3D and accepts an object of type MeshGeometry3D.
Example 2: Defining a geometry presenting a cube and applying it to a PointSeries3D
Example 3: Defining a geometry presenting a pyramid and applying it to a BarSeries3D
The Positions are defined in relative units between 0 and 1, according to the bounds of the data point visual.
Figure 2: BarSeries3D and PointSeries3D with custom geometries
Geometry and material selectors
The chart allows you to choose different geometries and materials for each data point based on its model.
You can use the DefaultVisualMaterialSelector property to set a material selector and choose material dynamically.
Example 4: Implementing material selector
Example 5: Defining material selector
To improve the chart's performance, it is recommended to cache and reuse the Material objects instead of creating new ones for each model. You can find a runnable project demonstrating how to implement a material selector in our GitHub SDK repository. The project also demonstrates a simple material caching implementation.
You can use the DefaultVisualGeometrySelector property to choose different geometry for each data point dynamically.