chart = {
const svg = d3.create("svg")
.attr("viewBox", [0, 0, 975, 610]);
svg.append(legend)
.attr("transform", "translate(870,450)");
svg.append("g")
.selectAll("path")
.data(topojson.feature(us, us.objects.TZ).features)
.join("path")
.attr("fill", d => color(data.get(d.properties.Region_Cod.toString())))
.attr("d", path)
.append("title")
.text(d => `${d.properties.Region_Nam}
${format(data.get(d.properties.Region_Cod.toString()))}`);
svg.append("path")
.datum(topojson.mesh(us, us.objects.TZ, (a, b) => a !== b))
.attr("fill", "none")
.attr("stroke", "white")
.attr("stroke-opacity", 0.1)
.attr("stroke-linejoin", "round")
.attr("d", path);
return svg.node();
}