我想要的是能够单击图表标题并执行操作,但是下一个最好的事情是图表级别的单击事件。我能够使用以下命令从事件中找到图表的标题:
this.title.element.innerHTML
this.title.element.innerText
this.title.element.childNodes[0].nodeValue
this.title.element.firstChild.data
this.title.element.firstChild.nodeValue
虽然上述所有内容在 IE8+ 中都有效,但在 FireFox 中不起作用。有什么想法吗?
最佳答案
您可以将标题的 useHTML 设置为 true:
title: {
text: 'testtest',
}
然后使用jquery事件click
$('.highcharts-title').click(function(){
alert('action');
});
关于javascript - 图表点击事件上的图表标题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15886780/