Merge legends

Extending only HorizontalLegend to cover Legend functionality.

Orignal PR #1415.
GitHub hide comment about it.
We do not have access to `this` inside `each` loop.