diff --git a/src/plugins/plugin.decimation.js b/src/plugins/plugin.decimation.js index d5dce1a739d..4f1db3661bd 100644 --- a/src/plugins/plugin.decimation.js +++ b/src/plugins/plugin.decimation.js @@ -233,6 +233,13 @@ export default { return; } + let {start, count} = getStartAndCountOfVisiblePointsSimplified(meta, data); + if (count <= 4 * availableWidth) { + // No decimation is required until we are above this threshold + cleanDecimatedDataset(dataset); + return; + } + if (isNullOrUndef(_data)) { // First time we are seeing this dataset // We override the 'data' property with a setter that stores the @@ -251,13 +258,6 @@ export default { }); } - let {start, count} = getStartAndCountOfVisiblePointsSimplified(meta, data); - if (count <= 4 * availableWidth) { - // No decimation is required until we are above this threshold - cleanDecimatedDataset(dataset); - return; - } - // Point the chart to the decimated data let decimated; switch (options.algorithm) {