Highcharts hover 的解决方法是什么

What is the solution for Highcharts hover

我用highchart jquery插件画面积图。通过 AJAX 调用需要传递 3 个数组来绘制图表。 x 轴的第一个数组数据。 Y 轴的第二个数组数据。第三个数组具有字符串值,需要将其与 y 轴值一起传递到 hover(max) 中。每个数组有 90 个值。是否可以将第三个阵列显示为悬停? 你能请任何人帮助我吗?

$('#divcontainer').highcharts({

        chart: {

            type: 'area'
        },
        credits: {
  enabled: false },plotOptions: {
         area: {
            events: {
                legendItemClick: function () {

                    return false; // <== returning false will cancel the default action
                }
            }
        ,
        showInLegend: true
    }
}, title: {
        text: 'Chart',
        x: -20 //center
    },
    subtitle: {
        text: '',
        x: -20
    },
    xAxis: {
          labels:{rotation: rot, x:-20},
           categories: data[0]

      },
    yAxis: {
        title: {
            text: 'Status'
        },
        plotLines: [{
            value:0,
            width: 1,
            color: '#808080'
        }]
    },
    tooltip:{
         enabled: true,
         formatter: function() {
                    return '<b>' + this.x + '</b><br/><b>' + 'Status: ' + this.y + '</b>';}},

series: [{
        name: 'Status',
        data: data[1]
        }]
}); 

data[0] is 1st array, data[1] is 2nd array, and data[2] is 3rd array。这些是来自 ajax 调用的数组。

也许你可以尝试这样的事情:

tooltip:{
         enabled: true,
         formatter: function() {
                    return '<b>' + this.x + '</b><br/><b>' + 'Status: ' + this.y + '</b>' + data[2][this.series.data.indexOf( this.point )];
         }
},

注意带data[2][this.series.data.indexOf( this.point )]的部分。