{
const svg = DOM.svg(width,60);
d3.select(svg)
.selectAll("rect")
.data(colors)
.enter()
.append("rect")
.attr("x", d => xColorScale(d))
.attr("y", 0)
.attr("width", xColorScale.bandwidth())
.attr("height", 30)
.style("fill", d => d)
.style("shape-rendering", "crispEdges")
d3.select(svg)
.selectAll("text")
.data(legend)
.enter()
.append("text")
.attr("x", (d,i) => xLegend(data.length/100*d))
.attr("y", 50)
.attr("dx", "0.32em")
.attr("text-anchor", "middle")
.style("font", "14px sans-serif")
.text(d => d + "%")
return svg
}