Created the legend with d3