SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, iOS Chart, Android Chart and JavaScript Chart Components
SciChart WPF ships with hundreds of WPF Chart Examples which you can browse, play with, view the source-code and even export each WPF Chart Example to a stand-alone Visual Studio solution. All of this is possible with the new and improved SciChart WPF Examples Suite, which ships as part of the SciChart WPF SDK.
The PointLine Chart demo shows how to create high-performance 3D PointLine with three-dimensional markers chart using the SciChart 3D Component.
The 3D PointLine chart is defined by the XyzDataSeries3D and the PointLineRenderableSeries3D.
The C#/WPF source code for the WPF 3D PointLine Chart Example example is included below (Scroll down!).
Did you know you can also view the source code from one of the following sources as well?
<UserControl x:Class="SciChart.Examples.Examples.Charts3D.CreateA3DChart.CreateAPointLine3DChart"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:ext="http://schemas.abtsoftware.co.uk/scichart/exampleExternals"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:s3D="http://schemas.abtsoftware.co.uk/scichart3D"
d:DesignHeight="400"
d:DesignWidth="600"
mc:Ignorable="d">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<!-- The SciChart3DInteractionToolbar adds rotate, orbit, zoom, pan, zoom extents functionality -->
<!-- to the chart and is included for example purposes. -->
<!-- If you wish to know how to zoom and pan a 3D chart then do a search for Zoom Pan in the Examples suite! -->
<ext:SciChart3DInteractionToolbar TargetSurface="{Binding Source={x:Reference Name=SciChart}}">
<ext:FlyoutSeparator Background="#444" />
<ext:FlyoutMenuButton Content="SIZE"
Padding="0"
Style="{StaticResource FlyoutMenuButtonStyle}">
<ext:FlyoutMenuButton.PopupContent>
<StackPanel MinWidth="150" Orientation="Vertical">
<TextBlock Text="Slide to change PointMarker Size" />
<ext:FlyoutSeparator />
<!-- Create the size slider -->
<Slider x:Name="SizeSlider"
Margin="4"
HorizontalAlignment="Stretch"
Maximum="3.0"
Minimum="0.1"
Orientation="Horizontal"
Value="2.0" />
</StackPanel>
</ext:FlyoutMenuButton.PopupContent>
</ext:FlyoutMenuButton>
<ext:FlyoutMenuButton Content="TN"
Padding="0"
Style="{StaticResource FlyoutMenuButtonStyle}">
<ext:FlyoutMenuButton.PopupContent>
<StackPanel MinWidth="150" Orientation="Vertical">
<TextBlock Text="Slide to change line Thickness" />
<ext:FlyoutSeparator />
<!-- Create the size slider -->
<Slider x:Name="ThicknessSlider"
Margin="4"
HorizontalAlignment="Stretch"
Maximum="5"
Minimum="1"
Orientation="Horizontal"
Value="2.0" />
</StackPanel>
</ext:FlyoutMenuButton.PopupContent>
</ext:FlyoutMenuButton>
<ext:FlyoutMenuButton Content="OP"
Padding="0"
Style="{StaticResource FlyoutMenuButtonStyle}">
<ext:FlyoutMenuButton.PopupContent>
<StackPanel MinWidth="150" Orientation="Vertical">
<TextBlock Text="Slide to change PointMarker Opacity" />
<ext:FlyoutSeparator />
<!-- Create the opacity slider -->
<Slider x:Name="OpacitySlider"
Margin="4"
HorizontalAlignment="Stretch"
Maximum="1.0"
Minimum="0.1"
Orientation="Horizontal"
Value="1.0" />
</StackPanel>
</ext:FlyoutMenuButton.PopupContent>
</ext:FlyoutMenuButton>
</ext:SciChart3DInteractionToolbar>
<s3D:SciChart3DSurface x:Name="SciChart"
Grid.Column="1"
BorderThickness="0"
WorldDimensions="200,100,200">
<s3D:SciChart3DSurface.RenderableSeries>
<!-- To create a Scatter Chart, create a ScatterRenderableSeries3D and use a 3D point marker type -->
<s3D:PointLineRenderableSeries3D x:Name="PointLineSeries3D"
IsAntialiased="True"
Opacity="{Binding Source={x:Reference OpacitySlider}, Path=Value}"
StrokeThickness="{Binding Source={x:Reference ThicknessSlider}, Path=Value}">
<s3D:PointLineRenderableSeries3D.PointMarker>
<s3D:SpherePointMarker3D Opacity="{Binding Source={x:Reference OpacitySlider}, Path=Value}" Size="{Binding Source={x:Reference SizeSlider}, Path=Value}" />
</s3D:PointLineRenderableSeries3D.PointMarker>
</s3D:PointLineRenderableSeries3D>
</s3D:SciChart3DSurface.RenderableSeries>
<s3D:SciChart3DSurface.XAxis>
<s3D:NumericAxis3D GrowBy="0.1,0.1" />
</s3D:SciChart3DSurface.XAxis>
<s3D:SciChart3DSurface.YAxis>
<s3D:NumericAxis3D GrowBy="0.1,0.1" />
</s3D:SciChart3DSurface.YAxis>
<s3D:SciChart3DSurface.ZAxis>
<s3D:NumericAxis3D GrowBy="0.1,0.1" />
</s3D:SciChart3DSurface.ZAxis>
<s3D:SciChart3DSurface.ChartModifier>
<s3D:ModifierGroup3D>
<s3D:FreeLookModifier3D ExecuteOn="MouseLeftButton"/>
<s3D:OrbitModifier3D ExecuteOn="MouseLeftButton" />
<s3D:VertexSelectionModifier3D ExecuteOn="MouseLeftButton" />
<s3D:MouseWheelZoomModifier3D />
<s3D:ZoomExtentsModifier3D AnimateDurationMs="500"
ResetPosition="200,200,200"
ResetTarget="0,0,0" />
</s3D:ModifierGroup3D>
</s3D:SciChart3DSurface.ChartModifier>
</s3D:SciChart3DSurface>
</Grid>
</UserControl>
// *************************************************************************************
// SCICHART® Copyright SciChart Ltd. 2011-2022. All rights reserved.
//
// Web: http://www.scichart.com
// Support: support@scichart.com
// Sales: sales@scichart.com
//
// CreateAPointLine3DChart.xaml.cs is part of the SCICHART® Examples. Permission is hereby granted
// to modify, create derivative works, distribute and publish any part of this source
// code whether for commercial, private or personal use.
//
// The SCICHART® examples are distributed in the hope that they will be useful, but
// without any warranty. It is provided "AS IS" without warranty of any kind, either
// expressed or implied.
// *************************************************************************************
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using SciChart.Charting3D.Model;
namespace SciChart.Examples.Examples.Charts3D.CreateA3DChart
{
public partial class CreateAPointLine3DChart : UserControl
{
private const int Count = 100;
public CreateAPointLine3DChart()
{
InitializeComponent();
Loaded += OnLoaded;
}
private void OnLoaded(object sender, RoutedEventArgs routedEventArgs)
{
var xyzDataSeries3D = new XyzDataSeries3D<double>();
var random = new Random(0);
for (var i = 0; i < Count; i++)
{
var x = 5*Math.Sin(i);
var y = i;
var z = 5*Math.Cos(i);
Color? randomColor = Color.FromArgb(0xFF, (byte) random.Next(50, 255), (byte) random.Next(50, 255), (byte) random.Next(50, 255));
var scale = (float) ((random.NextDouble() + 0.5)*3.0);
xyzDataSeries3D.Append(x, y, z, new PointMetadata3D(randomColor, scale));
}
PointLineSeries3D.DataSeries = xyzDataSeries3D;
}
}
}