LineSeries3D
The line series visualizes three dimensional data represented by a line shape. Each data point is defined by X, Z and Y values which determines its position in the plot area.
Declaratively defined series
You can use the code from Example 1 to create a LineSeries3D.
Example 1: Defining series in XAML
Figure 1: LineSeries3D
Data bound series
Example 2: Defining a model for the data points and setting up the data context
Example 3: Setting up the series
Showing point visuals
The line series supports visual elements for its data points. They are disabled by default.
To show the data point visual, set the PointSize property of the series.
Example 4: Setting point size in XAML
Example 5: Setting point size in code
Figure 2: Point visuals shown
Setting the line size
You can change the line size by setting the DefaultLineVisualDiameter property of the series.
Example 6: Setting the line diameter
Figure 3: Line diameter set to 25
Customizing the data point visuals
The visual elements that represent the LineSeries3D data points can be customized through the DefaultVisualMaterial and DefaultVisualGeometry properties of the series. Additionally, you can use the DefaultVisualMaterialSelector and DefaultVisualGeometrySelector to choose different materials and geometries based on a specific condition.
For more information, see the Customizing Cartesian Chart 3D Series help article.
Customizing the line visuals
The visual elements that represent the LineSeries3D's line can be customized through the DefaultLineVisualMaterial and DefaultLineVisualGeometry properties of the series. Additionally, you can use the DefaultLineVisualMaterialSelector and DefaultLineVisualGeometrySelector to choose different materials and geometries based on a specific condition.
By default the series will be drawn with a single 3D polyline element. If the plotted data contains null values, the corresponding data point won't be drawn - a gap will appear. In this case a new polyline visual will be rendered for each null value that cuts the line. Setting the DefaulLineVisualGeometry or the DefaulLineVisualGeometry will trigger an alternative rendering approach where a visual element for each line segment between two data points will be created.
-
Setting the line's color
To change the color of the line you can use the DefaultLineVisualMaterial property of the series.
Example 7: Setting default line visual material
Figure 4: Custom line visual material
-
Setting the geometry of the line segments
To change the geometry of the line segments you can use the DefaultLineVisualGeometry property of the series.
Example 8: Setting default line visual geometry
Figure 5: Custom line visual geometry
-
Select a color using the material selector
To change the material of the different line segments you can use the DefaultLineVisualMaterialSelector property of the series.
Example 9: Implementing a material selector
Example 10: Setting default line visual material selector
Figure 6: Line with random colors
-
Select a geometry using the geometry selector
To change the geometry of the different line segments you can use the DefaultLineVisualGeometrySelector property of the series.
Example 11: Implementing a geometry selector
Example 12: Setting default line visual geometry selector
Figure 7: Line with random colors