From 5f4a6d7941a3b0a7a69e6e2dcb0f7551c969bbe8 Mon Sep 17 00:00:00 2001 From: John Huddleston Date: Fri, 6 Mar 2020 13:16:02 -0800 Subject: [PATCH] Only truncate legend labels if they are strings Fixes a bug where the tree legend could not be displayed for numeric color by values because those values do not have a substring function. Closes #926. --- src/components/tree/legend/item.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/tree/legend/item.js b/src/components/tree/legend/item.js index 3b0dd20e7..3bd50ce95 100644 --- a/src/components/tree/legend/item.js +++ b/src/components/tree/legend/item.js @@ -35,7 +35,7 @@ const LegendItem = ({ style={{fontSize: 12, fill: darkGrey, fontFamily: dataFont}} > {label} - {label.substring(0, legendMaxLength)} + {typeof label === 'string' ? label.substring(0, legendMaxLength) : label} );