Skip to content

Commit

Permalink
fix to continue respecting 14days dtick
Browse files Browse the repository at this point in the history
  • Loading branch information
archmoj committed Mar 27, 2020
1 parent e7ff33d commit 79b6d95
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/constants/numerical.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ module.exports = {
*/
ONEAVGYEAR: 31557600000, // 365.25 days
ONEAVGMONTH: 2629800000, // 1/12 of ONEAVGYEAR
ONEWEEK: 604800000,
ONEDAY: 86400000,
ONEHOUR: 3600000,
ONEMIN: 60000,
Expand Down
3 changes: 2 additions & 1 deletion src/plots/cartesian/axes.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ var cleanTicks = require('./clean_ticks');
var constants = require('../../constants/numerical');
var ONEAVGYEAR = constants.ONEAVGYEAR;
var ONEAVGMONTH = constants.ONEAVGMONTH;
var ONEWEEK = constants.ONEWEEK;
var ONEDAY = constants.ONEDAY;
var ONEHOUR = constants.ONEHOUR;
var ONEMIN = constants.ONEMIN;
Expand Down Expand Up @@ -808,7 +809,7 @@ axes.autoTicks = function(ax, roughDTick) {
} else if(roughX2 > ONEDAY) {
if(ax._hasDayOfWeekBreaks) {
ax.dtick = roundDTick(roughDTick, ONEDAY, [1, 1.001, 7, 14]);
if(ax.dtick !== ONEDAY) ax.dtick = 7 * ONEDAY;
if(ax.dtick < ONEWEEK) ax.dtick = ONEWEEK;
} else {
ax.dtick = roundDTick(roughDTick, ONEDAY, roundDays);
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 79b6d95

Please sign in to comment.