Add in HorizontalLegend.

Lists entries side-by-side in the available width, after which the
entries wrap onto the next row. If an entry is too wide it is
truncated. If there are too many entries some rows will not be shown.

Close #755.
The variable name availableWidth is a tiny bit confusing as there is a mismatch between the availableWidth for the legend and the availableWidth considering the padding.  A better variable name would be greatly helpful.