let myChart = this.chart;
let index = 0; //默认选中第一个
myChart.dispatchAction({
type: "highlight",
seriesIndex: 0,
dataIndex: 0,
});
//下面的事件一定要写,如果不写会出现重影的情况
myChart.on("mouseover", function (e) {
if (e.dataIndex != index) {
myChart.dispatchAction({
type: "downplay",
seriesIndex: 0,
dataIndex: index,
});
}
});
myChart.on("mouseout", function (e) {
index = e.dataIndex;
myChart.dispatchAction({
type: "highlight",
seriesIndex: 0,
dataIndex: e.dataIndex,
});
});
