Search Results for

    Show / Hide Table of Contents

    PointMarker 3D API

    SciChart features a rich PointMarkers 3D API to annotate the data-points of certain 3D series with markers, e.g. Pyramid, Sphere, Ellipse, Quad or even a Custom Shape marker. Some series types, such as Scatter RenderableSeries 3D or Impulse RenderableSeries 3D, require a PointMarker3D assigned to them unless they won't render at all.

    This article is about how to configure and add PointMarkers 3D to a IRenderableSeries3D to render markers for every data point.

    PointMarkers 3D API

    Note

    Examples of Using PointMarkers API can be found in the SciChart Android Examples Suite as well as on GitHub:

    • Native Example
    • Xamarin Example

    PointMarker 3D Types

    SciChart provides several PointMarker 3D shapes out of the box, which are of 2 types: Flat-Texture and Mesh (Volumetric) which can be found below:

    Flat-Texture PointMarkers Mesh (Volumetric) PointMarkers
    TrianglePointerMarker3D PyramidPointMarker3D
    QuadPointMarker3D CubePointMarker3D
    EllipsePointMarker3D SpherePointMarker3D
    PixelPointMarker3D CylinderPointMarker3D
    CustomPointMarker3D

    It is possible to have a custom Flat-Texture PointMarker, and there is a CustomPointMarker3D for such purpose. It allows to render a point marker from a Bitmap. For more details, refer to the Custom PointMarkers 3D section down the page.

    All the PointMarker types are inherited from the BasePointMarker3D, which provides the following properties for styling point markers:

    PointMarker property Description
    size Allows to specify the size of a PointMarker. PointMarkers will not appear if this value isn't set.
    fill Specifies the fill color which will be used while drawing the PointMarker instance.
    markerType Defines the MarkerType for this point marker.

    Using PointMarkers 3D

    Code for creation and assigning a PointMarker 3D to a IRenderableSeries3D is essentially the same regardless of a PointMarker type. After an instance of it has been created, it can be configured and then applied to the pointMarker property:

    • Java
    • Java with Builders API
    • Kotlin
    // Create a Sphere PointMarker 3D instance
    final SpherePointMarker3D pointMarker = new SpherePointMarker3D();
    pointMarker.setSize(25);
    pointMarker.setFill(0xFFFF0000);
    
    // Apply the PointMarker to a PointLine Series 3D
    final PointLineRenderableSeries3D rs = new PointLineRenderableSeries3D();
    rs.setPointMarker(pointMarker);
    
    // Create a Sphere PointMarker 3D instance
    final SpherePointMarker3D pointMarker = sciChart3DBuilder.newSpherePointMarker3D()
            .withFill(0xFFFF0000)
            .withSize(25)
            .build();
    
    // Apply the PointMarker to a PointLine Series 3D
    final PointLineRenderableSeries3D rs = sciChart3DBuilder.newPointLinesSeries3D()
            .withPointMarker(pointMarker)
            .build();
    
    // Create a Sphere PointMarker 3D instance
    val pointMarker = SpherePointMarker3D()
    pointMarker.size = 25f
    pointMarker.fill = -0x10000
    
    // Apply the PointMarker to a PointLine Series 3D
    val rs = PointLineRenderableSeries3D()
    rs.pointMarker = pointMarker
    

    The code above will produce the following chart (assuming that the data has been added to the PointLine Series):

    PointMarker 3D Example

    Custom PointMarkers 3D

    SciChart Android 3D provides a possibility to draw custom Flat-Texture PointMarkers via the CustomPointMarker3D class. All you need to do - is to provide Bitmap texture which will be used as sprite, and then - rendered onto a 3d world.

    Please see the example below:

    • Java
    • Java with Builders API
    • Kotlin
    // Create custom PointMarker 3D
    final Bitmap bitmap = BitmapFactory.decodeResource(getContext().getResources(), R.drawable.example_weather_storm);
    CustomPointMarker3D pointMarker = new CustomPointMarker3D(bitmap);
    pointMarker.setSize(10);
    
    // Apply the PointMarker to a PointLine Series 3D
    final ScatterRenderableSeries3D rs = new ScatterRenderableSeries3D();
    rs.setPointMarker(pointMarker);
    
    // Create custom PointMarker 3D
    final Bitmap bitmap = BitmapFactory.decodeResource(getContext().getResources(), R.drawable.example_weather_storm);
    CustomPointMarker3D pointMarker = sciChart3DBuilder.newCustomPointMarker3D(bitmap)
            .withSize(10)
            .build();
    
    // Apply the PointMarker to a PointLine Series 3D
    final ScatterRenderableSeries3D rs = sciChart3DBuilder.newScatterSeries3D()
            .withPointMarker(pointMarker)
            .build();
    
    // Create custom PointMarker 3D
    val bitmap = BitmapFactory.decodeResource(requireContext().resources, R.drawable.example_weather_storm)
    val pointMarker = CustomPointMarker3D(bitmap)
    pointMarker.size = 10f
    
    // Apply the PointMarker to a PointLine Series 3D
    val rs = ScatterRenderableSeries3D()
    rs.pointMarker = pointMarker
    

    This would result in the following chart:

    Custom PointMarker 3D

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