chart = {
const svg = d3.create("svg")
.attr("viewBox", [0, 0, width, height]);
svg.append("text")
.attr("x", 700)
.attr("y", 120)
.attr("text-anchor", "middle")
.style("font-size", "14px")
.text("Income and Employment Disparity");
svg.append(legend)
.attr("transform", "translate(700,200)");
svg.append("g")
.selectAll("path")
.data(topojson.feature(polygons, polygons.objects.ireland31).features)
.join("path")
.attr("fill", d => color(data.get(d.properties[idAttribute])))
.attr("d", path)
.append("title")
.text(d => `${d.properties[COUNTYNAME]}, ${format(data.get(d.properties[idAttribute]))}`);
return svg.node();
}