chart = {
const zoomer = d3.zoom()
.on("zoom", null);
const svg = d3.create("svg")
.attr("title", data.barChartSVGTitle)
.attr("class", "svgWrapper")
.attr("width", width)
.attr("height", height)
.call(zoomer)
.on("wheel.zoom", scroll)
.on("mousedown.zoom", null)
.on("touchstart.zoom", null)
.on("touchmove.zoom", null)
.on("touchend.zoom", null);
const defs = svg.append("defs");
defs.append("clipPath")
.attr("id", "clip")
.call(clip);
svg.append("g")
.attr("class", "chart-title")
.call(chartTitle);
const mainGroup = svg.append("g")
.attr("class", "mainGroup");
const mainBarsGroup = mainGroup.append("g")
.attr("clip-path", "url(#clip)")
.attr("class", "mainBarsGroup");
const miniGroup = svg.append("g")
.attr("class", "miniGroup")
.attr("transform", "translate(" + minimapPositionTranslate + ")");
const brushGroup = svg.append("g")
.attr("class", "brushGroup")
.attr("transform", "translate(" + minimapPositionTranslate + ")")
.append("g")
.attr("class", "brush")
.call(brush);
brushGroup.selectAll("rect")
.attr("width", miniWidth);
brushGroup.call(brush.move, initialBrushXSelection);
const miniBars = miniGroup.selectAll(".bar")
.data(data, d => d.dayCount);
miniBars.enter().append("rect")
.attr("class", "bar")
.attr("x", d => miniXScale(d.x))
.attr("y", d => miniHeight - miniYScale(d.y))
.attr("width", miniXScale.bandwidth())
.attr("height", d => miniYScale(d.y))
.style("fill", barColor);
mainGroup.append("g")
.attr("class", "x-axis")
.call(mainXAxis);
const mainBars = mainBarsGroup.append("g")
.attr("class", "bars")
.selectAll("rect")
.data(data);
mainBars.join("rect")
.attr("role", "presentation")
.attr("class", "bar")
.attr("fill", barColor)
.attr("x", d => mainXScale(d.x))
.attr("y", d => mainHeight - mainYScale(d.y))
.attr("width", mainXScale.bandwidth())
.attr("height", d => mainYScale(d.y));
svg.append("g")
.call(chartBy)
return svg.node();
}