chart = {
const chart = new G2.Chart({
width,
height: 800
});
const names = new Set(population.map((d) => d.name));
const colors = d3.quantize(
(t) => d3.interpolateSpectral(t * 0.8 + 0.1),
names.size
);
chart.coordinate({ type: "theta" });
chart
.interval()
.data(population)
.scale("color", { range: colors, guide: null })
.encode("y", "value")
.encode("color", "name")
.encode("label", "name")
.encode("tooltip", "value")
.style("label", { position: "inside" })
.style("stroke", "white");
return node(chart.render());
}