chart = {
const svg = d3.create("svg")
.attr("viewBox", [0, 0, width, height]);
const bars = svg.append("g")
.attr("class", "bars");
const s = bars.selectAll("g").data(series)
.join("g")
.attr("class", "series")
.attr("fill", d => color(d.key))
.selectAll("rect")
.data(d => d)
.join("rect")
.attr("x", d => x(d.data.day))
.attr("y", d => y(d[1]))
.attr("height", d => y(d[0]) - y(d[1]))
.attr("width", x.bandwidth())
.append("title")
.text(d => `${d.data.day} ${d.key}: ${d.data[d.key]} hours`);
const xAx = svg.append("g").call(xAxis);
const yAx = svg.append("g").call(yAxis);
svg.append("text")
.attr("transform", "rotate(-90)")
.attr("y", -5)
.attr("x", -height/2)
.attr("dy", "1em")
.style("text-anchor", "middle")
.text("Hours");
return svg.node();
}