Skip to content

Commit

Permalink
an nullish legend should not be displayed as tet "undefined" (#746)
Browse files Browse the repository at this point in the history
fixes #745
  • Loading branch information
Fil authored Feb 9, 2022
1 parent 2545560 commit 8bffb4b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/legends.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ export function Legends(scales, options) {
for (const [key, value] of legendRegistry) {
const o = options[key];
if (o && o.legend) {
legends.push(value(scales[key], legendOptions(scales[key], o), key => scales[key]));
const legend = value(scales[key], legendOptions(scales[key], o), key => scales[key]);
if (legend != null) legends.push(legend);
}
}
return legends;
Expand Down

0 comments on commit 8bffb4b

Please sign in to comment.