Skip to content

Commit

Permalink
round dtick 2 to 7 on rangebreaks with day of week pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
archmoj committed Mar 27, 2020
1 parent 7ad4317 commit c340efc
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/plots/cartesian/axes.js
Original file line number Diff line number Diff line change
Expand Up @@ -807,11 +807,7 @@ axes.autoTicks = function(ax, roughDTick) {
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;
}
if(ax._hasDayOfWeekBreaks && ax.dtick < 7 * ONEDAY) ax.dtick = 7 * ONEDAY;

// get week ticks on sunday
// this will also move the base tick off 2000-01-01 if dtick is
Expand Down
Binary file modified test/image/baselines/axes_breaks-round-weekdays.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 c340efc

Please sign in to comment.