Skip to content

Commit efe9767

Browse files
committed
on rangebreaks with week of day pattern - round to 1 only if really close to 1
1 parent c340efc commit efe9767

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/plots/cartesian/axes.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -806,8 +806,12 @@ axes.autoTicks = function(ax, roughDTick) {
806806
roughDTick /= ONEAVGMONTH;
807807
ax.dtick = 'M' + roundDTick(roughDTick, 1, roundBase24);
808808
} else if(roughX2 > ONEDAY) {
809-
ax.dtick = roundDTick(roughDTick, ONEDAY, roundDays);
810-
if(ax._hasDayOfWeekBreaks && ax.dtick < 7 * ONEDAY) ax.dtick = 7 * ONEDAY;
809+
if(ax._hasDayOfWeekBreaks) {
810+
ax.dtick = roundDTick(roughDTick, ONEDAY, [1, 1.001, 7, 14]);
811+
if(ax.dtick !== ONEDAY) ax.dtick = 7 * ONEDAY;
812+
} else {
813+
ax.dtick = roundDTick(roughDTick, ONEDAY, roundDays);
814+
}
811815

812816
// get week ticks on sunday
813817
// this will also move the base tick off 2000-01-01 if dtick is
Loading

0 commit comments

Comments
 (0)