Skip to content

Commit a416665

Browse files
committed
fix bug when text attr is a string
1 parent 3cb2f47 commit a416665

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/traces/bar/cross_trace_calc.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -793,7 +793,9 @@ function estimateAxisPaddingForText(trace, calcTrace) {
793793
}
794794
var nLines = trace.texttemplate
795795
? countLines(trace.texttemplate)
796-
: Math.max(...trace.text.map((t) => countLines(t)));
796+
: isArrayOrTypedArray(trace.text)
797+
? Math.max(...trace.text.map((t) => countLines(t)))
798+
: countLines(trace.text);
797799

798800
const padAmount = trace.outsidetextfont.size * nLines + TEXTPAD;
799801
return {

0 commit comments

Comments
 (0)