Highcharts : Chart with drilldown how to obtain click event of drill up button
Solution 1
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
Solution 2
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).
![Rahul Gupta](https://i.stack.imgur.com/9RQMa.jpg?s=256&g=1)
Rahul Gupta
I am a full-stack web developer working with technologies such as NodeJs, ReactJs, PHP, Jquery, AJAX, JSON, MySQL. I like to help others and it makes me feel happy when my code helps somebody to solve their problems. Using this platform, I try my best to contribute to the developers community with all my programming knowledge and coding skills :)
Updated on June 15, 2022Comments
-
Rahul Gupta about 2 years
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 }