PlotOptions.series.point.events returns null point data when using a sweep

I bind a click event for each point in the series to get the data associated with the point.

plotOptions: {
        series: {
            point: {
                events: {
                    click: function () {
                       console.log("that > ", this);
                    }
                }
            }
        }
    }

      

If I have a diagram without a drill down, it works fine ( fiddle ).

However, if I define a fiddle , I can only get the point data for the inner series. The point data is zero for the slice I just clicked to expand.

this > c {series: null, name: null, y: null, drilldown: null, options: null…}

      

Is this a bug or am I missing something?

+3


source to share


2 answers


This is mistake.



Reported to our developers here .

+1


source


This is because your click handler is triggered when the clicked element has already disappeared. Looks like a bug.

A quick fix would be to change the older js / modules / drilldown.src.js around line 513 to look like this:



// Add the click event to the point label
H.addEvent(point, 'click', function () {
    setTimeout(function() {
        point.doDrilldown();
    }, 100);
});

      

Here's a change to the fiddle .

+1


source







All Articles