Skip to content

Commit 8bffb4b

Browse files
authored
an nullish legend should not be displayed as tet "undefined" (#746)
fixes #745
1 parent 2545560 commit 8bffb4b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/legends.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ export function Legends(scales, options) {
7676
for (const [key, value] of legendRegistry) {
7777
const o = options[key];
7878
if (o && o.legend) {
79-
legends.push(value(scales[key], legendOptions(scales[key], o), key => scales[key]));
79+
const legend = value(scales[key], legendOptions(scales[key], o), key => scales[key]);
80+
if (legend != null) legends.push(legend);
8081
}
8182
}
8283
return legends;

0 commit comments

Comments
 (0)