problem description
when using share dataset in the official echart4.0 example in vue, the pie chart above is updated by listening for updateAxisPointer events, but it is found that sometimes the label data of the pie chart has been updated, but the chart has not been redrawn, but the pie chart will be redrawn when the mouse is moved outside the area of the column chart below. I have seen the setTimeout function useful in the code of the official example, and I don"t know if this is the crux of the problem.
the environmental background of the problems and what methods you have tried
vue2.5.16 echart4.1.0
here I encapsulate echart as a component, and then call it somewhere else, such as echart.vue and dashboard-barpie.vue
related codes
/ / Please paste the code text below (do not replace the code with pictures)
/ / echart.vue
this.myChart.on("updateAxisPointer", event => {
var xAxisInfo = event.axesInfo[0];
if (xAxisInfo) {
this.$emit("change-barpie", xAxisInfo);
}
});
/ / dashboard-barpie.vue
< echart: options= "option": chartID= "chartID" ref= "dashboard_barpie_chart": height= "height" vMuzonghuza Barpiec = "changeBarpie": chartType= ""dashboard-barpie"" > < / echart >
changeBarpie(xAxisInfo) {
var dimension = xAxisInfo.value + 1;
this.$refs.dashboard_barpie_chart.setOption({
series: {
id: "pie",
label: {
formatter: "{b}: {@[" + dimension + "]} ({d}%)"
},
encode: {
value: dimension,
tooltip: dimension
}
}
});
}
what result do you expect? What is the error message actually seen?
this is when the mouse hovers over the middle column area, the label data of the pie chart is updated, but the pie chart is obviously not redrawn
.