susielu / d3-legend

A reusable d3 legend component.
http://d3-legend.susielu.com/
Apache License 2.0
727 stars 104 forks source link

Linear legends with custom label formats #10

Closed tamc closed 9 years ago

tamc commented 9 years ago

Linear legends weren't working for me if I used a custom label format. e.g.,

legend.labelFormat(d3.format('%'));

would produce labels that used percentages, but the coloured boxes would be the wrong colours.

This patch fixes the problem for me.

susielu commented 9 years ago

Awesome, thanks for providing a pull request!