Skip to content

Commit

Permalink
should not move by a week or quarter when the labels are not weekly o…
Browse files Browse the repository at this point in the history
…r quarterly
  • Loading branch information
archmoj committed Aug 19, 2020
1 parent b318e8b commit beed352
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/plots/cartesian/axes.js
Original file line number Diff line number Diff line change
Expand Up @@ -791,22 +791,17 @@ axes.calcTicks = function calcTicks(ax, opts) {
} else {
periodLength = ONEAVGYEAR;
}
} else if(delta >= ONEMINQUARTER) {
if(
definedDelta && // case of specified by tickfomat
actualDelta >= ONEMINQUARTER && actualDelta <= ONEMAXQUARTER
) {
} else if(definedDelta === ONEAVGQUARTER && delta >= ONEMINQUARTER) {
if(actualDelta >= ONEMINQUARTER && actualDelta <= ONEMAXQUARTER) {
periodLength = actualDelta;
} else {
periodLength = ONEAVGQUARTER;
}
} else if(delta >= ONEMINMONTH) {
if(actualDelta >= ONEMINMONTH && actualDelta <= ONEMAXMONTH) {
periodLength = actualDelta;
} else {
periodLength = ONEAVGMONTH;
}
} else if(delta >= ONEWEEK) {
} else if(definedDelta === ONEWEEK && delta >= ONEWEEK) {
periodLength = ONEWEEK;
} else if(delta >= ONEDAY) {
periodLength = ONEDAY;
Expand Down
Binary file modified test/image/baselines/date_axes_period.png
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 beed352

Please sign in to comment.