Put the legend inside an svg g element