diff --git a/src/plots/cartesian/axes.js b/src/plots/cartesian/axes.js index 8d01860439b..3a2ee355658 100644 --- a/src/plots/cartesian/axes.js +++ b/src/plots/cartesian/axes.js @@ -806,12 +806,7 @@ axes.autoTicks = function(ax, roughDTick) { roughDTick /= ONEAVGMONTH; ax.dtick = 'M' + roundDTick(roughDTick, 1, roundBase24); } else if(roughX2 > ONEDAY) { - ax.dtick = roundDTick(roughDTick, ONEDAY, roundDays); - - if(ax._hasDayOfWeekBreaks) { - if(ax.dtick === 2 * ONEDAY) ax.dtick = ONEDAY; - else if(ax.dtick === 3 * ONEDAY) ax.dtick = 7 * ONEDAY; - } + ax.dtick = roundDTick(roughDTick, ONEDAY, ax._hasDayOfWeekBreaks ? [1, 7, 14] : roundDays); // get week ticks on sunday // this will also move the base tick off 2000-01-01 if dtick is diff --git a/test/image/baselines/axes_breaks-round-weekdays.png b/test/image/baselines/axes_breaks-round-weekdays.png index 18360013266..98a7e1e38af 100644 Binary files a/test/image/baselines/axes_breaks-round-weekdays.png and b/test/image/baselines/axes_breaks-round-weekdays.png differ diff --git a/test/image/mocks/axes_breaks-round-weekdays.json b/test/image/mocks/axes_breaks-round-weekdays.json index 9e8231aaaec..2391aa636b2 100644 --- a/test/image/mocks/axes_breaks-round-weekdays.json +++ b/test/image/mocks/axes_breaks-round-weekdays.json @@ -2073,8 +2073,8 @@ } ], "range": [ - "2015-11-07", - "2015-11-21" + "2015-11-06 12:00", + "2015-11-23 12:00" ] }, "yaxis2": {