chart = {
const svg = d3.select(DOM.svg(width, height));
svg.append("g")
.selectAll("g")
.data(series)
.join("g")
.attr("fill", d => color(d.key))
.selectAll("rect")
.data(d => d)
.join("rect")
.attr("x", d => x(d[0]))
.attr("y", (d, i) => y(d.data.name))
.attr("width", d => x(d[1]) - x(d[0]))
.attr("height", y.bandwidth());
svg.append("g")
.attr("fill", "black")
.attr("text-anchor", "start")
.style("font", "18px sans-serif")
.selectAll("text")
.data(data)
.join("text")
.attr("x", 10)
.attr("y", d => y(d.name) + y.bandwidth() / 2)
.attr("dy", "0.35em")
.text(function(d) {
return d.name});
svg.append("g")
.call(xAxis);
svg.append("g")
.call(yAxis);
return svg.node();
}