correct place to put the legend markup