]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Fix sampleSize option (#6586)
authorBen McCann <322311+benmccann@users.noreply.github.com>
Wed, 23 Oct 2019 00:59:22 +0000 (17:59 -0700)
committerEvert Timberg <evert.timberg+github@gmail.com>
Wed, 23 Oct 2019 00:59:22 +0000 (20:59 -0400)
src/core/core.scale.js

index 29134180cae5cabc7f6297124c3cc27e743a58b9..b4553a86afdf98f705af7c626f21e1162c977683 100644 (file)
@@ -448,7 +448,7 @@ var Scale = Element.extend({
 
                // Compute tick rotation and fit using a sampled subset of labels
                // We generally don't need to compute the size of every single label for determining scale size
-               samplingEnabled = sampleSize > ticks.length;
+               samplingEnabled = sampleSize < ticks.length;
                labels = me._convertTicksToLabels(samplingEnabled ? sample(ticks, sampleSize) : ticks);
 
                // _configure is called twice, once here, once from core.controller.updateLayout.