SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, iOS Chart, Android Chart and JavaScript Chart Components
Please note! These examples are new to SciChart Mobile v3 release! SciChart iOS & Android ship with Xamarin.iOS and Xamarin.Android bindings around our native iOS & Android Chart controls, allowing you to create fast & feature rich charts to your Xamarin applications. We include ~90 native iOS examples and 90 Android examples, but now also ~60 Xamarin Chart Examples to help you get started with SciChart. You can download the source for our Xamarin Chart Examples from Github, or browse the source code below.
This example demonstrates how to create a Point-Cloud example with SciChart Xamarin.iOS and Xamarin.Android. This cart type is rendered with the help of Scatter Series, where the shapes of scatters is defined by the Point Markers.
See more in the SciChart Xamarin Tutorials and Documentation about the Scatter Series: Creating a chart in Xamarin.Android Creating a chart in Xamarin.iOS The Scatter Chart type Android The Scatter Chart Type iOS
The C#/Xamarin.iOS/Xamarin.Android source code for the Xamarin Create Free Surface Chart 3D Chart example is included below (Scroll down!).
Did you know you can also view the source code from one of the following sources as well?
using Xamarin.Examples.Demo.Data;
using SciChart.iOS.Charting;
namespace Xamarin.Examples.Demo.iOS
{
[Example3DDefinition("Point Cloud 3D Chart", description: "Create a simple Point Cloud 3D Chart", icon: ExampleIcon.Scatter3D)]
class PointCloud3DChartViewController : SingleChartViewController<SCIChartSurface3D>
{
protected override void InitExample()
{
var dataManager = DataManager.Instance;
var dataSeries3D = new XyzDataSeries3D<double, double, double>();
for (int i = 0; i < 10000; i++)
{
double x = dataManager.GetGaussianRandomNumber(5, 1.5);
double y = dataManager.GetGaussianRandomNumber(5, 1.5);
double z = dataManager.GetGaussianRandomNumber(5, 1.5);
dataSeries3D.Append(x, y, z);
}
var rSeries3D = new SCIScatterRenderableSeries3D
{
DataSeries = dataSeries3D,
PointMarker = new SCIEllipsePointMarker3D { FillColor = 0x77ADFF2F, Size = 3f },
};
using (Surface.SuspendUpdates())
{
Surface.XAxis = new SCINumericAxis3D { GrowBy = new SCIDoubleRange(0.1, 0.1) };
Surface.YAxis = new SCINumericAxis3D { GrowBy = new SCIDoubleRange(0.1, 0.1) };
Surface.ZAxis = new SCINumericAxis3D { GrowBy = new SCIDoubleRange(0.1, 0.1) };
Surface.RenderableSeries.Add(rSeries3D);
Surface.ChartModifiers.Add(CreateDefault3DModifiers());
Surface.Camera = new SCICamera3D { Position = new SCIVector3(-350, 100, -350), Target = new SCIVector3(0, 50, 0) };
}
}
}
}
using System.Drawing;
using SciChart.Charting3D.Common.Math;
using SciChart.Charting3D.Model;
using SciChart.Charting3D.Model.DataSeries.Xyz;
using SciChart.Charting3D.Modifiers;
using SciChart.Charting3D.Visuals;
using SciChart.Charting3D.Visuals.Axes;
using SciChart.Charting3D.Visuals.Camera;
using SciChart.Charting3D.Visuals.PointMarkers;
using SciChart.Charting3D.Visuals.RenderableSeries.Scatter;
using SciChart.Data.Model;
using Xamarin.Examples.Demo.Data;
using Xamarin.Examples.Demo;
using Xamarin.Examples.Demo.Droid.Fragments.Base;
namespace Xamarin.Examples.Demo.Droid.Fragments.Examples3D
{
[Example3DDefinition("Simple Point Cloud 3D Chart", description: "Create a simple Point Cloud 3D Chart", icon: ExampleIcon.Scatter3D)]
class CreatePointCloud3DChartFragment : ExampleBaseFragment
{
public SciChartSurface3D Surface => View.FindViewById<SciChartSurface3D>(Resource.Id.chart3d);
public override int ExampleLayoutId => Resource.Layout.Example_Single_3D_Chart_Fragment;
protected override void InitExample()
{
var dataManager = DataManager.Instance;
var dataSeries3D = new XyzDataSeries3D<double, double, double>();
for (int i = 0; i < 10000; i++)
{
double x = dataManager.GetGaussianRandomNumber(5, 1.5);
double y = dataManager.GetGaussianRandomNumber(5, 1.5);
double z = dataManager.GetGaussianRandomNumber(5, 1.5);
dataSeries3D.Append(x, y, z);
}
var pointMarker3D = new EllipsePointMarker3D()
{
FillColor = Color.FromArgb(0x77, 0xAD, 0xFF, 0x2F),
Size = 5f
};
var renderableSeries3D = new ScatterRenderableSeries3D()
{
PointMarker = pointMarker3D,
DataSeries = dataSeries3D
};
using (Surface.SuspendUpdates())
{
Surface.XAxis = new NumericAxis3D() { GrowBy = new DoubleRange(0.1, 0.1) };
Surface.YAxis = new NumericAxis3D() { GrowBy = new DoubleRange(0.1, 0.1) };
Surface.ZAxis = new NumericAxis3D() { GrowBy = new DoubleRange(0.1, 0.1) };
Surface.Camera = new Camera3D()
{
Position = new Vector3(-350, 100, -350),
Target = new Vector3(0, 50, 0)
};
Surface.RenderableSeries.Add(renderableSeries3D);
Surface.ChartModifiers = new ChartModifier3DCollection
{
new PinchZoomModifier3D(),
new OrbitModifier3D(),
new ZoomExtentsModifier3D()
};
}
}
}
}