Skip to content

Commit beed352

Browse files
committed
should not move by a week or quarter when the labels are not weekly or quarterly
1 parent b318e8b commit beed352

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

src/plots/cartesian/axes.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -791,22 +791,17 @@ axes.calcTicks = function calcTicks(ax, opts) {
791791
} else {
792792
periodLength = ONEAVGYEAR;
793793
}
794-
} else if(delta >= ONEMINQUARTER) {
795-
if(
796-
definedDelta && // case of specified by tickfomat
797-
actualDelta >= ONEMINQUARTER && actualDelta <= ONEMAXQUARTER
798-
) {
794+
} else if(definedDelta === ONEAVGQUARTER && delta >= ONEMINQUARTER) {
795+
if(actualDelta >= ONEMINQUARTER && actualDelta <= ONEMAXQUARTER) {
799796
periodLength = actualDelta;
800-
} else {
801-
periodLength = ONEAVGQUARTER;
802797
}
803798
} else if(delta >= ONEMINMONTH) {
804799
if(actualDelta >= ONEMINMONTH && actualDelta <= ONEMAXMONTH) {
805800
periodLength = actualDelta;
806801
} else {
807802
periodLength = ONEAVGMONTH;
808803
}
809-
} else if(delta >= ONEWEEK) {
804+
} else if(definedDelta === ONEWEEK && delta >= ONEWEEK) {
810805
periodLength = ONEWEEK;
811806
} else if(delta >= ONEDAY) {
812807
periodLength = ONEDAY;
134 Bytes
Loading

0 commit comments

Comments
 (0)