add a directive for configuring the legend of the chart
add tests for the legend directive