handleSelectedActive(myEcharts, currentIndex, isSet, index) {
const that = this;
let option = myEcharts.getOption();
var chartHover = function() {
var dataLen = option.series[0].data.length;
console.log(that.mapCurrentIndex);
myEcharts.dispatchAction({
type: "downplay",
seriesIndex: 0,
dataIndex: that.mapCurrentIndex,
});
that.mapCurrentIndex = (that.mapCurrentIndex + 1) % dataLen;
myEcharts.dispatchAction({
type: "highlight",
seriesIndex: 0,
dataIndex: that.mapCurrentIndex,
});
myEcharts.dispatchAction({
type: "showTip",
seriesIndex: 0,
dataIndex: that.mapCurrentIndex,
});
};
myEcharts.on("mouseover", function(param) {
isSet = false;
clearInterval(that.setIntervalArr[index]);
myEcharts.dispatchAction({
type: "downplay",
seriesIndex: 0,
dataIndex: that.mapCurrentIndex,
});
myEcharts.dispatchAction({
type: "highlight",
seriesIndex: 0,
dataIndex: param.dataIndex,
});
myEcharts.dispatchAction({
type: "showTip",
seriesIndex: 0,
dataIndex: param.dataIndex,
});
that.mapCurrentIndex = param.dataIndex;
});
that.setIntervalArr[index] = setInterval(chartHover, 2000);
myEcharts.on("mouseout", function() {
if (!isSet) {
that.setIntervalArr[index] = setInterval(chartHover, 2000);
isSet = true;
}
});
},