brunano21
Posts: 3
Joined: Thu Nov 29, 2018 9:45 am

Drilldown event

Thu Nov 29, 2018 9:52 am

Hi,
I'm using a pie with drilldown series. I'm able to load the drilldown series asynchronously using the chartOptions.chart.events.drilldown function. However, I'd like to intercept any click event that occurs on a drilldown point but so far I have been that lucky. The docs did not help either. Any suggestion how I can achieve that?
Thanks.

rafalS
Posts: 693
Joined: Thu Jun 14, 2018 11:40 am

Re: Drilldown event

Thu Nov 29, 2018 10:22 am

Hi, brunano21!

What do you mean saying "I'd like to intercept any click event that occurs on a drilldown point"? Are you looking for this?

Code: Select all

chart: {
    type: 'pie',
    events: {
      drilldown(e) {
        console.log(e) // Event
        console.log(this) // Chart
      }
    }
  },
jsFiddle: https://jsfiddle.net/BlackLabel/tbz2auj1/

Best regards!
Rafal Sebestjanski,
Highcharts Developer

brunano21
Posts: 3
Joined: Thu Nov 29, 2018 9:45 am

Re: Drilldown event

Thu Nov 29, 2018 10:25 am

Hi rafaIS,

Thanks for the quick answer. This is already what I'm doing. But if click again on one of the drilldown points, the drilldown function is not invoked.

rafalS
Posts: 693
Joined: Thu Jun 14, 2018 11:40 am

Re: Drilldown event

Thu Nov 29, 2018 10:36 am

You have 2 series objects in options - main series and drilldown series. You can use click event inside drilldown series like in this example: https://jsfiddle.net/BlackLabel/krfjs1nz/
Rafal Sebestjanski,
Highcharts Developer

brunano21
Posts: 3
Joined: Thu Nov 29, 2018 9:45 am

Re: Drilldown event

Thu Nov 29, 2018 10:40 am

Awesome, this is what I have been looking for!

Thank you very much!

Code: Select all

...
  "drilldown": {
    "series": [{
        point: {
          events: {
            click() {
              console.log('Below is point clicked after drilldown')
              console.log(this)
            }
          }
        },
        "name": "Chrome",
        "id": "Chrome",
        "data": [ ... ]
...
Last edited by brunano21 on Thu Nov 29, 2018 10:46 am, edited 1 time in total.

rafalS
Posts: 693
Joined: Thu Jun 14, 2018 11:40 am

Re: Drilldown event

Thu Nov 29, 2018 10:41 am

You're welcome ;)
Rafal Sebestjanski,
Highcharts Developer

Return to “Highcharts Usage”