Skip to content

Commit d1ba367

Browse files
committed
keep the one with the largest requested value first
1 parent 7a1c649 commit d1ba367

7 files changed

+2
-2
lines changed

src/plots/cartesian/axes.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -636,15 +636,15 @@ axes.calcTicks = function calcTicks(ax) {
636636

637637
var newTickVals = [];
638638
var prevPos;
639-
for(var q = 0; q < len; q++) {
639+
for(var q = len - 1; q > -1; q--) { // apply reverse loop to pick greater values in breaks first
640640
var pos = ax.c2p(tickVals[q].value);
641641

642642
if(prevPos === undefined || Math.abs(pos - prevPos) > tf2) {
643643
prevPos = pos;
644644
newTickVals.push(tickVals[q]);
645645
}
646646
}
647-
tickVals = newTickVals;
647+
tickVals = newTickVals.reverse();
648648
}
649649
}
650650

Loading
35 Bytes
Loading
2 Bytes
Loading
Loading
Loading

test/image/baselines/axes_breaks.png

329 Bytes
Loading

0 commit comments

Comments
 (0)