pyramidChart = {
const svg = d3.create("svg")
.attr("viewBox", [0, 0, width, height])
.attr("font-family", "sans-serif")
.attr("font-size", 10);
svg.append("g")
.selectAll("rect")
.data(aggregateList)
.join("rect")
.attr("fill", d => d3.schemeSet1[d.gender === "male" ? 1 : 0])
.attr("x", d => d.gender === "male" ? xMale(d.value) : xFemale(0))
.attr("y", d => y(d.age))
.attr("width", d => d.gender === "male" ? xMale(0) - xMale(d.value) : xFemale(d.value) - xFemale(0))
.attr("height", y.bandwidth());
return svg.node();
}