let xAxis = SCINumericAxis3D()
xAxis.growBy = SCIDoubleRange(min: 0.1, max: 0.1)
let yAxis = SCINumericAxis3D()
yAxis.growBy = SCIDoubleRange(min: 0.1, max: 0.1)
let zAxis = SCINumericAxis3D()
zAxis.growBy = SCIDoubleRange(min: 0.1, max: 0.1)
let dataSeries = SCIXyzDataSeries3D(xType: .double, yType: .double, zType: .double)
let pointMetaDataProvider = SCIPointMetadataProvider3D()
for i in 0 ..< 100 {
let x = 5 * sin(Double(i))
let y = Double(i)
let z = 5 * cos(Double(i))
dataSeries.append(x: x, y: y, z: z)
let metadata = SCIPointMetadata3D(vertexColor: SCDDataManager.randomColor(), andScale: SCDDataManager.randomScale())
pointMetaDataProvider.metadata.add(metadata)
}
let pointMarker = SCISpherePointMarker3D()
pointMarker.fillColor = UIColor.red.colorARGBCode()
pointMarker.size = 10.0
let rs = SCIPointLineRenderableSeries3D()
rs.dataSeries = dataSeries
rs.strokeThickness = 3.0
rs.pointMarker = pointMarker
rs.isLineStrips = true
rs.metadataProvider = pointMetaDataProvider
SCIUpdateSuspender.usingWith(surface) {
self.surface.xAxis = xAxis
self.surface.yAxis = yAxis
self.surface.zAxis = zAxis
self.surface.renderableSeries.add(rs)
self.surface.chartModifiers.add(ExampleViewBase.createDefault3DModifiers())
}
var dataManager = DataManager.Instance;
var dataSeries3D = new XyzDataSeries3D();
var metadataProvider = new SCIPointMetadataProvider3D();
for (int i = 0; i < 100; i++)
{
double x = 5 * Math.Sin(i);
double y = i;
double z = 5 * Math.Cos(i);
dataSeries3D.Append(x, y, z);
var metadata = new SCIPointMetadata3D((uint)dataManager.GetRandomColor().ToArgb(), dataManager.GetRandomScale());
metadataProvider.Metadata.Add(metadata);
}
var rSeries3D = new SCIPointLineRenderableSeries3D
{
DataSeries = dataSeries3D,
StrokeThickness = 2f,
IsLineStrips = true,
PointMarker = new SCISpherePointMarker3D { Size = 5f },
MetadataProvider = metadataProvider,
};
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) };
}
In the code above, a Point-Line Series 3D instance is created. It is assigned to draw the data that is provided by the ISCIDataSeries3D assigned to it.
The line is drawn with a stroke color provided by SCIPointMetadataProvider3D instance, but in this particular example, we used our MetadataProvider 3D API, which provides custom colors for individual points of the series.
Finally, the Point-Line Series 3D is added to the ISCIChartSurface3D.renderableSeries property.
NOTE: For more information about MetadataProviders - please refer to the MetadataProvider 3D API article.
Add Point Markers onto a Point-Line3D Series
Every data point of a Point-Line 3D Series can be marked with a PointMarker 3D.
To add Point Markers to the Point-Line 3D, use the following code: