Color legend | D3 | Observable
•ojs
•ojs
•ojs
•ojs
•ojs
•ojs
•ojs
•ojs
•ojs
•ojs
•ojs
•ojs
•ojs
•ojs
•ojs
•ojs
•ojs
Comments (3)
Andres Snitcofsky
Apr 14, 2021
is there any way to "insert" this type of legend into another svg block ? So to have both the viz and the legend in the same block to be able to "download as png" alltogether?
Mike Bostock
Apr 14, 2021
Yes, legend() returns an SVG element, so you can just append it to another SVG element and set the transform attribute if desired.
quackas
Dec 9, 2021
How would I increase the font size of the labels?
Reply
Add comment
Subscribe to notifications
Observable
Sign in
D3
Mike Bostock
310
Reply
Add comment
Subscribe to notifications
322
Color legend | D3 | Observable