myChart4.getZr().on('click',function (params) {
let pointInPixel= [params.offsetX,params.offsetY];
if(myChart4.containPixel('grid',pointInPixel)){
let pointInGrid=myChart4.convertFromPixel({seriesIndex: 0},pointInPixel);
let xIndex=pointInGrid[0] //获取下标
}
})
Close the click event of echarts, get the xIndex column through the click position, 0 represents the 1st column, and then use this to find your local data to complete the click effect.