Aatish Molasi
Aatish Molasi

Reputation: 2186

Highcharts click event on dataLabel which is using HTML

So here's the issue .. I have used an image to represent the datalabels in a chart, and i need to set the 'useHTML' flag to true in order to do that ..

But if i set the flag to true it does not allow me to bind click events to the datalabels .. is there any way to get around this ..

Heres the fiddle

Upvotes: 0

Views: 1858

Answers (1)

Igor Shastin
Igor Shastin

Reputation: 2888

You can set onClick handler this way:

$(chartObj.series[0].data[6].dataLabel.div.lastChild).bind('click', function(e) {
    alert('clicked!')
})

jsFiddle here.

Upvotes: 2

Related Questions