Skip to content

Commit

Permalink
Remove autoSkip logic to always display last tick
Browse files Browse the repository at this point in the history
This changes the behavior of `autoSkip` so that it does not force the
display of the last tick. If the last tick can be displayed with equal
spacing to the rest of the ticks, it will be. Otherwise, it is not.
  • Loading branch information
sgray committed Dec 5, 2018
1 parent 7c45fda commit e8eca6e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/core/core.scale.js
Expand Up @@ -669,9 +669,8 @@ module.exports = Element.extend({
for (i = 0; i < tickCount; i++) {
tick = ticks[i];

// Since we always show the last tick,we need may need to hide the last shown one before
shouldSkip = (skipRatio > 1 && i % skipRatio > 0) || (i % skipRatio === 0 && i + skipRatio >= tickCount);
if (shouldSkip && i !== tickCount - 1) {
shouldSkip = (skipRatio > 1 && i % skipRatio > 0);
if (shouldSkip) {
// leave tick in place but make sure it's not displayed (#4635)
delete tick.label;
}
Expand Down

0 comments on commit e8eca6e

Please sign in to comment.