Make the number of columns in the legend dependent on chart width. Closes #19.