score:4

Accepted answer

if you don't want to use jquery you can use it as follows

chart.xaxis[0].labelgroup.element.childnodes.foreach(function(label)
{
    label.style.cursor = "pointer";
    label.onclick = function(){
      alert('you clicked on '+this.textcontent);
    }
});

complete code at http://jsfiddle.net/t07ok5v3/5/

score:0

i get error: object doesn't support property or method 'foreach' when running the solution from malay sarkar in internet explorer. here's a workaround i used which works in both chrome and ie.

for (let i = 0; chart.xaxis[0].labelgroup.element.childnodes.length; i++)
{
    chart.xaxis[0].labelgroup.element.childnodes[i].onclick = function(){
      alert('you clicked on '+this.textcontent);
    }
});

score:2

alternate solution, maintained since highcharts v3 is to use custom events plugin. plugin adds a lot of new event, natively not supported by highcharts.

demo: https://jsfiddle.net/blacklabel/utx8g/963/

events are added the same way as official events in highcharts, and we don't need to re-inspect every release the dom:

xaxis: {
  labels: {
    events: {
      click: function () { ... }
    }
  }
}

Related Query

More Query from same tag