admin管理员组

文章数量:1240583

I am using Highcharts wtih drilldown and here is my working FIDDLE.

How can I get the click event of the drill up button ? I have referred the Highcharts API but can't figure out how can I incorporate this into my code.

I want to do something like:

drillUp: function(){
     //get point details by using something like this or this.point
     //get series details by using something like point.series
}

I am using Highcharts wtih drilldown and here is my working FIDDLE.

How can I get the click event of the drill up button ? I have referred the Highcharts API but can't figure out how can I incorporate this into my code.

I want to do something like:

drillUp: function(){
     //get point details by using something like this or this.point
     //get series details by using something like point.series
}
Share Improve this question edited Jul 11, 2017 at 5:06 Rahul Gupta asked Jun 30, 2014 at 11:50 Rahul GuptaRahul Gupta 10.1k7 gold badges64 silver badges69 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 12

You need to catch the event. See the chart.events.drillup API doc. To get the series and points in the series you would do something like:

    events: {
        drillup: function (e) {
            console.log(this);
            console.log(this.options.series[0].name);
            console.log(this.options.series[0].data[0].name);
        }
    }

Since you did not state which series or points you wanted this is the most general method.

Link to the updated working FIDDLE

chart: {
         type: 'column',
         events: {
            drillup: function (e) {
                   alert(e.seriesOptions.name);
            }
        }     
    }

From the below line,

e.seriesOptions.name

You will get the series name, which you are loading, by clicking that back button(drill up button).

本文标签: javascriptHighchartsChart with drilldown how to obtain click event of drill up buttonStack Overflow