Skip to content

Commit 3cb2f47

Browse files
committed
fix bug with non-string values
1 parent f044df3 commit 3cb2f47

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/traces/bar/cross_trace_calc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -788,7 +788,7 @@ function estimateAxisPaddingForText(trace, calcTrace) {
788788
) {
789789
// count number of lines by counting <br> elements
790790
function countLines(text) {
791-
const BR_TAG_ALL = /<br\s*\/?>/gi;
791+
if (!text || typeof text !== 'string') return 0;
792792
return (text.match(BR_TAG_ALL) || []).length + 1;
793793
}
794794
var nLines = trace.texttemplate

0 commit comments

Comments
 (0)