Skip to content

Commit e0bd026

Browse files
committed
more fixups for period tickformat
1 parent 37a0840 commit e0bd026

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/plots/cartesian/axes.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -702,8 +702,8 @@ axes.calcTicks = function calcTicks(ax, opts) {
702702
var maxRange = Math.max(rng[0], rng[1]);
703703

704704
var definedDelta;
705-
var tickformat = axes.getTickFormat(ax); // don't use ax.tickformat directly
706-
if(isPeriod) {
705+
var tickformat = axes.getTickFormat(ax);
706+
if(isPeriod && tickformat) {
707707
if(
708708
!(/%[fLQsSMHIpX]/.test(tickformat))
709709
// %f: microseconds as a decimal number [000000, 999999]
@@ -946,7 +946,8 @@ axes.autoTicks = function(ax, roughDTick) {
946946
// 2 or 3 days... but that's a weird enough case that we'll ignore it.
947947
ax.tick0 = Lib.dateTick0(ax.calendar, true);
948948

949-
if(/%[uVW]/.test(ax.tickformat)) { // should we use axes.getTickFormat(ax) instead here?
949+
var tickformat = axes.getTickFormat(ax);
950+
if(/%[uVW]/.test(tickformat)) { // should we use axes.getTickFormat(ax) instead here?
950951
// replace Sunday with Monday for ISO and Monday-based formats
951952
var len = ax.tick0.length;
952953
var lastD = +ax.tick0[len - 1];

0 commit comments

Comments
 (0)