We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4f271d9 commit 778f483Copy full SHA for 778f483
src/plots/cartesian/axes.js
@@ -682,8 +682,11 @@ axes.calcTicks = function calcTicks(ax, opts) {
682
ax._inCalcTicks = true;
683
684
var isPeriod = ax.ticklabelmode === 'period';
685
- var definedDelta;
+ var minRange, maxRange, definedDelta;
686
if(isPeriod && ax.tickformat) {
687
+ minRange = Math.min(rng[0], rng[1]);
688
+ maxRange = Math.max(rng[0], rng[1]);
689
+
690
var _has = function(str) {
691
return ax.tickformat.indexOf(str) !== -1;
692
};
@@ -743,6 +746,10 @@ axes.calcTicks = function calcTicks(ax, opts) {
743
746
}
744
747
745
748
ticksOut[i].periodX = v;
749
750
+ if(v > maxRange || v < minRange) { // hide label if outside the range
751
+ ticksOut[i].text = '';
752
+ }
753
754
755
0 commit comments