About the mobile side using the echarts map component and adding click events in provinces and regions

demand: use the map component in echarts4 on the mobile page, add the click event of the province, and request the backend to obtain the detailed data and display it in a pop-up window.

status quo:

  1. Provincial click event uses click event

       this.mapChart.on("click", (params) => {
         // do something
     })
    

question:
but on mobile, clicking sometimes doesn"t work. You have to double-click the province. This is why, ah, please give us some advice.

Thank you!

May.23,2021

try tap


1, change to echart version (eliminate framework problems) 2, write a simple click event (eliminate mobile problems)


myChart.getZr().on('click',  (params) => { //echartsgetzrApixindex
    var pointInPixel= [params.offsetX, params.offsetY];
    myChart.containPixel('grid',pointInPixel)
    if (myChart.containPixel('grid',pointInPixel)) {
 var xIndex=myChart.convertFromPixel({seriesIndex:0},[params.offsetX, params.offsetY])[0];
     // xindex xindexdata
    }
  });
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e8f6bd-1256.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e8f6bd-1256.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?