Search Results for

    Show / Hide Table of Contents

    What is Data Resampling and how does it work?

    By default, SciChart uses resampling (culling) of data to ensure the minimum viable data-set is displayed on the screen. Resampling is intended to be lossless, and automatic. It occurs for every RenderableSeries before the series is rendered, if required.

    Resampling methods make assumptions about the data in order to produce a valid output. SciChart provides variety of the ResamplingMode, and auto detects the most suitable one.

    However, there are cases when data input cannot be resampled accurately. Good examples could be plotting unsorted data or using logarithmic scale on an axis. We recommend using None in such situations, which in other word means switching Resampling off.

    Note

    Please be aware that if you disable resampling you will experience a degradation in performance.

    Resampling Modes

    There are several ResamplingMode available in SciChart:

    Resampling Modes Description
    None switches off Resampling on a IRenderableSeries.
    MinMax suitable for evenly-spaced data. Resamples by taking the min-max of oversampled data.
    Min suitable for evenly-spaced data. Resamples by taking the minimum point of oversampled data.
    Max suitable for evenly-spaced data. Resamples by taking the maximum point of oversampled data.
    Mid suitable for evenly-spaced data. Resamples by taking the median point of oversampled data.
    Auto This is the default mode. It auto-detects the most suitable resampling algorithm - fastest and most accurate - for the type of data appended.
    Cluster2D Groups close points in 2D space
    MinMaxWithUnevenSpacing not suitable for evenly-spaced data. Resamples by taking the min-max of oversampled data.

    Setting Resampling Mode

    Most of the time, you don't need to set ResamplingMode manually. SciChart auto detects the best one for a given data and uses it internally. However, when it is necessary, the ResamplingMode can be set explicitly via the resamplingMode property:

    • Java
    • Java with Builders API
    • Kotlin
    // Create a DataSeries with unsorted data
    final IXyDataSeries<Double, Double> unsortedDataSeries = new XyDataSeries<>(Double.class, Double.class);
    unsortedDataSeries.setAcceptsUnsortedData(true);
    
    final FastLineRenderableSeries rSeries = new FastLineRenderableSeries();
    // Set a DataSeries with unsorted data
    rSeries.setDataSeries(unsortedDataSeries);
    
    // Switch off Resampling because the DataSeries is unsorted
    rSeries.setResamplingMode(ResamplingMode.None);
    
    // Create a DataSeries with unsorted data
    final XyDataSeries unsortedDataSeries = sciChartBuilder.newXyDataSeries(Double.class, Double.class)
            .withAcceptsUnsortedData()
            .build();
    
    final FastLineRenderableSeries rSeries = sciChartBuilder.newLineSeries()
            // Set a DataSeries with unsorted data
            .withDataSeries(unsortedDataSeries)
            // Switch off Resampling because the DataSeries is unsorted
            .withResamplingMode(ResamplingMode.None)
            .build();
    
    // Create a DataSeries with unsorted data
    val unsortedDataSeries: IXyDataSeries<Double, Double> = XyDataSeries(Double::class.java, Double::class.java).apply {
        acceptsUnsortedData = true
    }
    
    val rSeries = FastLineRenderableSeries().apply {
        // Set a DataSeries with unsorted data
        dataSeries = unsortedDataSeries
    
        // Switch off Resampling because the DataSeries is unsorted
        resamplingMode = ResamplingMode.None
    }
    

    Resampling Performance

    Resampling makes drawing many millions of points possible with SciChart. For instance, in the Performance Demo example, we push 1000 points every 10ms to three series on a chart. The point count quickly rises to the millions of points, and SciChart is still rendering at interactive rates. Also, the example allows to play around with different ResamplingMode and see their impact on performance.

    In addition, we compared performance of the most popular Android charting packages with SciChart. The results can be found in the Performance Comparison article.

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