Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

programmatically click on column in Highcharts

I have a simple drilldown chart: jsfiddle

Depending on the selected values in a table I need to dynamically click on specific column in this chart. How can I do that? I found how to click on the legend area, but not on column.

I tried to simply trigger a click event on the specific column, but in this way it not works:

$('rect:not(:first):nth-child(1):first').click()

I assume sth must be hidden in the charts api, but I can't see where it is.

like image 238
lkurylo Avatar asked Jul 10 '13 12:07

lkurylo


1 Answers

You cna use built-in function for firing events: firePointEvent(type). See: http://jsfiddle.net/7xEhW/31/

For first column it is: chart.series[0].data[0].firePointEvent('click');

FirePointEvent is not part of docs, but it's used internally.

like image 52
Paweł Fus Avatar answered Nov 04 '22 03:11

Paweł Fus