javascript - Column Chart: Click event to only trigger on drilldown series -


i working on 2 level column chart. want perform task showing alert on clicking each bar on chart on drilldown series only. have found this:

plotoptions: {     series: {         cursor: 'pointer',         point: {             events: {                 click: function () {                     alert('category: ' + this.category + ', value: ' + this.y);                 }             }         }     } } 

it works fine, fires parent series too. can force click event work on 2nd level series (that appears after drilldown)?

because this value of click event object no values if click parent, check x value (or similar) see if destroyed parent or clicking available point. make sure it's value know point have.

for example (jsfiddle):

var undefined;  $('#container').highcharts({     plotoptions: {         series: {             point: {                 events: {                     click: function() {                         if(this.x != undefined)                             alert("it's alive!");                     }                 }             }         }     }     // ... }); 

if concerns specific series consider adding event code specific series, instead of doing general code series.


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -