使用鼠标悬停显示或隐藏高图工具提示

时间:2019-08-14 07:53:37

标签: highcharts

我用高图制作了一张地图,如果那个省有数据,我想显示或隐藏带有数据的工具提示。我认为在使用鼠标悬停事件时,我只能将其放在所有地图中,而不是每个省或国家/地区中。 有想法吗?

问题:mouseOver中的组件会占据所有地图,而不是我将鼠标移到的省份。

this.chartMap = {         ...

    tooltip: {
      animation: true,
      backgroundColor: 'grey',
      headerFormat: '',
      borderWidth: 0,
      shadow: true,
      useHTML: true,
      style: {
        opacity: 0.8,
        color: 'white',
        textTrasnform: 'capitalize'
      },

    ...

    series: [{
       events: { //HERE
          mouseOver: (function (component) {
            return function (e: any) {
              console.log('COMPONET: ', component);
            };
          })(this),
          click: (function (component) {
            return function (e: any) {
              ...
            };
          })(this)
        },
        name: this.mapName,
        states: {
          hover: {
            brightness: 0,
            borderColor: 'gray'
          }
        },
        ...
        allAreas: true,
        data: this.data,
        joinBy: 'hc-key'
      } as Highcharts.SeriesMapOptions]
  };

我需要的只是获取我将鼠标移到的省份数据,而不是整个国家/地区

0 个答案:

没有答案