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
Post a Comment