chart = {
const svg = d3.create("svg").attr("height", height).attr("width", width)
svg.selectAll("rect")
.data(groupedData)
.join("rect")
.attr("width", xScale.bandwidth())
.attr("height", d => height - yScale(d[1]))
.attr("x", d => xScale(d[0]))
.attr("y", d => yScale(d[1]))
return svg.node()
}