chart = {
const svg = d3.create("svg").attr("viewBox", [0, 0, width, height]);
const bandwidth = x.bandwidth();
const y0 = y(0);
svg
.append("g")
.attr("fill", color)
.attr("stroke", color)
.attr("fill-opacity", 0.3)
.selectAll("path")
.data(data)
.join("path")
.attr("transform", (d, i) => `translate(${x(i) + bandwidth * 0.5}, ${y0})`)
.attr("d", d => spike(height - y(d.value), bandwidth));
svg.append("g").call(xAxis);
svg.append("g").call(yAxis);
return svg.node();
}