let index = 0;
setTimeout(() => {
myChart.dispatchAction({
type: "highlight",
dataIndex: 0, //默认选中第一个
});
}, 0);
myChart.on("mouseover", (e) => {
if (e.dataIndex != index) {
myChart.dispatchAction({
type: "downplay",
seriesIndex: 0,
dataIndex: index,
});
}
});
myChart.on("mouseout", (e) => {
index = e.dataIndex;
myChart.dispatchAction({
type: "highlight",
seriesIndex: 0,
dataIndex: e.dataIndex,
});
});
echrts环形图默认选中,且不会消失
于 2023-10-20 10:12:04 首次发布