susielu / d3-legend

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

Line wrapping #8

Closed axelson closed 7 years ago

axelson commented 9 years ago

Is it possible to add line wrapping for long legend titles?

ming-codes commented 9 years ago

There are other plugins that provides features like these.

Checkout the awesome d3-jetpack

susielu commented 9 years ago

Oh cool, thanks!

On Sat, Sep 19, 2015 at 11:27 PM, Ming Liu notifications@github.com wrote:

There are other plugins that provides features like these.

Checkout the awesome d3-jetpack https://github.com/gka/d3-jetpack#d3wordwrap

— Reply to this email directly or view it on GitHub https://github.com/susielu/d3-legend/issues/8#issuecomment-141752736.

aendra-rininsland commented 7 years ago

d3-jetpack wordwrap only works for text; what about a feature that allows multi-line legends? That would also likely alleviate the need to add another library for wordwrapping legend text; you could simply add more padding to each item, and have two or more rows/columns of items.

susielu commented 7 years ago

@axelson I've added the functionality to allow for text wrapping for the title, example here: http://d3-legend.susielu.com/#color-quant

@aendrew I'll think about adding in functionality for multi-line legends. Will probably start with enabling text-wrapping for labels first.

Thanks! Susie