Search Results for

    Show / Hide Table of Contents

    The Point-Line 3D Chart Type

    The 3D Point-Line Charts are provided by the PointLineRenderableSeries3D class.

    Point-Line 3D Series Type (No PointMarkers)

    Note

    Examples of the Point-Line 3D Series can be found in the SciChart Android Examples Suite as well as on GitHub:

    • Native Example
    • Xamarin Example

    Besides the Common Features which are shared between all 3D Chart Types, the PointLineRenderableSeries3D allows you to customize it's specific properties:

    Feature Description
    stroke allows to specify the stroke color of the lines.
    strokeThickness allows to specify Line thickness.
    isAntialiased allows to specify if lines should be antialiased or not.
    isLineStrips Defines a value indicating whether the lines should be drawn as line strips or as separate lines. See the IsLineStrips Property section.

    Also, it is possible to show a gap in a Point-Line 3D Series simply by passing a data-point with a NaN as the Y value.

    IsLineStrips Property

    The PointLineRenderableSeries3D can be configured to split the line at every other point. This is quite useful if you want to use it to draw a free-form grid. That's achieved via the isLineStrips property.

    Line Strips Example

    Note

    Full example sources are available in 3D Charts -> Tooltips and Hit-Test 3D Charts -> Series Tooltips 3D Chart

    Create a Line Series

    To create a PointLineRenderableSeries3D, use the following code:

    • Java
    • Java with Builders API
    • Kotlin
    final NumericAxis3D xAxis = new NumericAxis3D();
    xAxis.setGrowBy(new DoubleRange(.1, .1));
    
    final NumericAxis3D yAxis = new NumericAxis3D();
    yAxis.setGrowBy(new DoubleRange(.1, .1));
    
    final NumericAxis3D zAxis = new NumericAxis3D();
    zAxis.setGrowBy(new DoubleRange(.1, .1));
    
    final XyzDataSeries3D<Double, Double, Double> ds = new XyzDataSeries3D<>(Double.class, Double.class, Double.class);
    final PointMetadataProvider3D pointMetaDataProvider = new PointMetadataProvider3D();
    
    for (int i = 0; i < 100; i++) {
        final double x = 5 * Math.sin(i);
        final double y = i;
        final double z = 5 * Math.cos(i);
        ds.append(x, y, z);
    
        final PointMetadataProvider3D.PointMetadata3D metadata = new PointMetadataProvider3D.PointMetadata3D(dataManager.getRandomColor());
        pointMetaDataProvider.metadata.add(metadata);
    }
    
    final SpherePointMarker3D pointMarker = new SpherePointMarker3D();
    pointMarker.setFill(Color.RED);
    pointMarker.setSize(10);
    
    final PointLineRenderableSeries3D rs = new PointLineRenderableSeries3D();
    rs.setDataSeries(ds);
    rs.setStrokeThickness(convertValueToDp(3f));
    rs.setPointMarker(pointMarker);
    rs.setIsLineStrips(true);
    rs.setMetadataProvider(pointMetaDataProvider);
    
    UpdateSuspender.using(surface, () -> {
        surface.setXAxis(xAxis);
        surface.setYAxis(yAxis);
        surface.setZAxis(zAxis);
        surface.getRenderableSeries().add(rs);
        surface.getChartModifiers().add(createDefaultModifiers3D());
    });
    
    final NumericAxis3D xAxis = sciChart3DBuilder.newNumericAxis3D().withGrowBy(.1, .1).build();
    final NumericAxis3D yAxis = sciChart3DBuilder.newNumericAxis3D().withGrowBy(.1, .1).build();
    final NumericAxis3D zAxis = sciChart3DBuilder.newNumericAxis3D().withGrowBy(.1, .1).build();
    
    final XyzDataSeries3D<Double, Double, Double> ds = new XyzDataSeries3D<>(Double.class, Double.class, Double.class);
    final PointMetadataProvider3D pointMetaDataProvider = new PointMetadataProvider3D();
    
    for (int i = 0; i < 100; i++) {
        final double x = 5 * Math.sin(i);
        final double y = i;
        final double z = 5 * Math.cos(i);
        ds.append(x, y, z);
    
        final PointMetadataProvider3D.PointMetadata3D metadata = new PointMetadataProvider3D.PointMetadata3D(dataManager.getRandomColor());
        pointMetaDataProvider.metadata.add(metadata);
    }
    
    final SpherePointMarker3D pointMarker = sciChart3DBuilder.newSpherePointMarker3D()
            .withFill(Color.RED)
            .withSize(10)
            .build();
    
    final PointLineRenderableSeries3D rs = sciChart3DBuilder.newPointLinesSeries3D()
            .withDataSeries(ds)
            .withStrokeThicknes(3f)
            .withPointMarker(pointMarker)
            .withIsLineStrips(true)
            .withMetadataProvider(pointMetaDataProvider)
            .build();
    
    UpdateSuspender.using(surface, () -> {
        surface.setXAxis(xAxis);
        surface.setYAxis(yAxis);
        surface.setZAxis(zAxis);
        surface.getRenderableSeries().add(rs);
        surface.getChartModifiers().add(createDefaultModifiers3D());
    });
    
    val xAxis = NumericAxis3D()
    xAxis.growBy = DoubleRange(.1, .1)
    val yAxis = NumericAxis3D()
    yAxis.growBy = DoubleRange(.1, .1)
    val zAxis = NumericAxis3D()
    zAxis.growBy = DoubleRange(.1, .1)
    
    val ds = XyzDataSeries3D(Double::class.java, Double::class.java, Double::class.java)
    val pointMetaDataProvider = PointMetadataProvider3D()
    
    for (i in 0..99) {
        val x = 5 * Math.sin(i.toDouble())
        val y = i.toDouble()
        val z = 5 * Math.cos(i.toDouble())
        ds.append(x, y, z)
    
        val metadata = PointMetadata3D(dataManager.randomColor)
        pointMetaDataProvider.metadata.add(metadata)
    }
    
    val pointMarker = SpherePointMarker3D()
    pointMarker.fill = Color.RED
    pointMarker.size = 10f
    
    val rs = PointLineRenderableSeries3D()
    rs.dataSeries = ds
    rs.strokeThickness = convertValueToDp(3f)
    rs.pointMarker = pointMarker
    rs.isLineStrips = true
    rs.metadataProvider = pointMetaDataProvider
    
    UpdateSuspender.using(surface) {
        surface.xAxis = xAxis
        surface.yAxis = yAxis
        surface.zAxis = zAxis
        surface.renderableSeries.add(rs)
        surface.chartModifiers.add(createDefaultModifiers3D())
    }
    

    In the code above, a Point-Line Series 3D instance is created. It is assigned to draw the data that is provided by the IDataSeries3D<TX,TY,TZ> assigned to it. The line is drawn with a stroke color provided by PointMetadataProvider3D 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 getRenderableSeries() 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:

    • Java
    • Java with Builders API
    • Kotlin
    final SpherePointMarker3D pointMarker = new SpherePointMarker3D();
    pointMarker.setSize(5);
    
    final PointLineRenderableSeries3D rs = new PointLineRenderableSeries3D();
    rs.setPointMarker(pointMarker);
    
    final SpherePointMarker3D pointMarker = sciChart3DBuilder.newSpherePointMarker3D()
            .withSize(5)
            .build();
    
    final PointLineRenderableSeries3D rs = sciChart3DBuilder.newPointLinesSeries3D()
            .withPointMarker(pointMarker)
            .build();
    
    val pointMarker = SpherePointMarker3D()
    pointMarker.size = 5f
    
    val rs = PointLineRenderableSeries3D()
    rs.pointMarker = pointMarker
    

    Point-Line 3D Series Type

    To learn more about Point Markers 3D, please refer to the PointMarkers 3D API article.

    Note

    This feature can be used to create a Scatter 3D Series.

    Paint Line Segments With Different Colors

    Is SciChart, you can draw line segments with different colors using the MetadataProvider 3D API. To Use metadata provider for Point-Line 3D Series - a PointMetadataProvider3D.PointMetadata3D has to be provided to the metadataProvider property. For more information - please refer to the MetadataProvider 3D API article.

    Back to top © 2011-2025 SciChart. All rights reserved. | sitemap.xml