chartInstance = {
const chart = new G2.Chart({
container: "container",
height: 320
});
chart.coordinate({ type: "theta", innerRadius: 0, outerRadius: 0.8 });
chart.data(data);
chart.interaction({ type: "tooltip" }).interaction({
type: "elementHighlight",
highlightedStroke: "black",
highlightedZIndex: 1
});
chart
.interval()
.transform({ type: "stackY" })
.encode("y", "value")
.encode("color", "id")
.label({
text: "value",
fontWeight: "bold",
position: "outside",
transform: [{ type: "spider" }, { type: "dodgeY" }]
})
.style("stroke", "#fff")
.style("lineWidth", 1)
.legend(false)
.encode("enterType", "waveIn")
.encode("updateType", "waveIn")
.interaction({ type: "tooltip" });
chart.render();
return chart;
}