工具提示中的(Highcharts)按钮无法触发

Lyn*_*hen 2 javascript highcharts

单击时,工具提示中的按钮没有任何动作,甚至没有设置onclick事件。下面是一个例子

http://jsfiddle.net/emzmvth4/

tooltip: {
        useHTML: true,
        formatter: function() {
                return '<div>' + this.point.date
                + '<br\><span>$' + this.y 
                + '</span><br\><button onclick="testAlert()">test test test</button></div>';
        },
    },



function testAlert() {
        alert('test');
};
Run Code Online (Sandbox Code Playgroud)

mor*_*ree 6

将工具提示的指针事件属性更改为'auto'

  tooltip: {
        // pointFormat: '<div>{point.date}<br\>{point.air}<br\>${point.y}</div><button>test</button>',
    useHTML: true,
    formatter: function() {
            return '<div>'+this.point.date+'<br\>'+this.point.air+'<br\><span>$'+this.y+'</span><br\><a href="http://www.w3schools.com">testtesttest</a></div>';
    },
    style: {
      pointerEvents: 'auto'
    }
},
Run Code Online (Sandbox Code Playgroud)

现场例子

http://jsfiddle.net/emzmvth4/1/