Highcharts 导航器鼠标悬停不工作

时间:2021-06-30 14:57:27

标签: highcharts

当我从左右调整底部导航器的大小时,鼠标悬停在工具提示上时停止工作,但是当缩放设置为 YTD 或 ALL 时它工作正常,我该如何解决这个问题?谢谢!

https://jsfiddle.net/BlackLabel/anp4L9do/1

    series: [{
    type: 'spline',
    name: 'Price',
    point: {
      events: {
        mouseOver: function(e) {
          var point = this,
            chart = point.series.chart;

          chart.series[1].points[point.index].setState('hover');
        },
        mouseOut: function(e) {
          var point = this,
            chart = point.series.chart;

          chart.series[1].points[point.index].setState('normal');
        },
      },
    },
    states: {
      inactive: {
        opacity: 1
      }
    },
    data: [
      [1541514600000, 20100.92],
      [1543847400000, 18428.466]
    ]
  }, {
    type: 'column',
    name: 'Volume',
    data: [
      [1541514600000, 31882900],
      [1543847400000, 40802500]
    ],
    states: {
      inactive: {
        opacity: 1
      }
    },
    enableMouseTracking: false,
    yAxis: 1
  }]
});

  

1 个答案:

答案 0 :(得分:0)

一个包含点的数组被简化为只有可见的点,使用 data 数组代替:

point: {
  events: {
    mouseOver: function(e) {
      var point = this,
        chart = point.series.chart;

      chart.series[1].data[point.index].setState('hover');
    },
    mouseOut: function(e) {
      var point = this,
        chart = point.series.chart;

      chart.series[1].data[point.index].setState('normal');
    },
  },
}

现场演示: https://jsfiddle.net/BlackLabel/gnkjf8q9/