@@ -280,7 +280,7 @@ var Scale = Element.extend({
280
280
var me = this ;
281
281
var tickOpts = me . options . ticks ;
282
282
var sampleSize = tickOpts . sampleSize ;
283
- var i , ilen , labels , ticks ;
283
+ var i , ilen , labels , ticks , samplingEnabled ;
284
284
285
285
// Update Lifecycle - Probably don't want to ever extend or overwrite this function ;)
286
286
me . beforeUpdate ( ) ;
@@ -345,7 +345,8 @@ var Scale = Element.extend({
345
345
346
346
// Compute tick rotation and fit using a sampled subset of labels
347
347
// We generally don't need to compute the size of every single label for determining scale size
348
- labels = me . _convertTicksToLabels ( sampleSize ? sample ( ticks , sampleSize ) : ticks ) ;
348
+ samplingEnabled = sampleSize > ticks . length ;
349
+ labels = me . _convertTicksToLabels ( samplingEnabled ? sample ( ticks , sampleSize ) : ticks ) ;
349
350
350
351
// _configure is called twice, once here, once from core.controller.updateLayout.
351
352
// Here we haven't been positioned yet, but dimensions are correct.
@@ -365,7 +366,7 @@ var Scale = Element.extend({
365
366
// Auto-skip
366
367
me . _ticksToDraw = tickOpts . display && tickOpts . autoSkip ? me . _autoSkip ( ticks ) : ticks ;
367
368
368
- if ( sampleSize ) {
369
+ if ( samplingEnabled ) {
369
370
// Generate labels using all non-skipped ticks
370
371
labels = me . _convertTicksToLabels ( me . _ticksToDraw ) ;
371
372
}
0 commit comments