SciChart Android 2D Charts API > 2D Chart Types > Renderable Series APIs > Data Resampling
Data Resampling

How does Data Resampling work?

By default, SciChart uses resampling (culling) of data to ensure the minimum viable dataset 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 ResamplingModes, 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 switching Resampling off (setting ResamplingMode.None) in such situations.

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

Resampling Modes

There are several ResamplingModes available in SciChart:

  • ResamplingMode.Auto - the default mode. Auto-detects the most suitable resampling algorithm (fastest and most accurate) for the type of data appended.
  • ResamplingMode.None - switches off Resampling on a RenderableSeries.
  • ResamplingMode.MinMax - suitable for evenly-spaced data. Resamples by taking the min-max of oversampled data.
  • ResamplingMode.MinMaxWithUnevenSpacing - suitable for not evenly-spaced data. Resamples by taking the min-max of oversampled data.
  • ResamplingMode.Min - suitable for evenly-spaced data. Resamples by taking the minimum point of oversampled data.
  • ResamplingMode.Max - suitable for evenly-spaced data. Resamples by taking the maximum point of oversampled data.
  • ResamplingMode.Mid - suitable for evenly-spaced data. Resamples by taking the median point 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. There is the setResamplingMode() method for this:

IRenderableSeries lineSeries = new FastLineRenderableSeries();
lineSeries.setStrokeStyle(new SolidPenStyle(ColorUtil.Green, true, 2f, null));

// Set a DataSeries with unsorted data

// Switch off Resampling because the DataSeries is unsorted

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 ResamplingModes 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.

See Also