Skip to content

Commit 3734680

Browse files
committed
respect tick0 for monthly dtick
1 parent 272534c commit 3734680

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/plots/cartesian/axes.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -841,7 +841,18 @@ axes.calcTicks = function calcTicks(ax, opts) {
841841
var tickVals = [];
842842
var xPrevious = null;
843843

844-
var dTick = numDtick ? ax.dtick : ax._roughDTick;
844+
var dTick;
845+
if(numDtick) {
846+
dTick = ax.dtick;
847+
} else {
848+
if(ax.type === 'date') {
849+
if(typeof ax.dtick === 'string' && ax.dtick.charAt(0) === 'M') {
850+
dTick = ONEAVGMONTH * ax.dtick.substring(1);
851+
}
852+
} else {
853+
dTick = ax._roughDTick;
854+
}
855+
}
845856

846857
var id = Math.round((
847858
ax.r2l(x) -

0 commit comments

Comments
 (0)