Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drilldown event on chart fires multiple Times on stacked column series #2989

Closed
FLoibl opened this issue Apr 29, 2014 · 14 comments
Closed

Drilldown event on chart fires multiple Times on stacked column series #2989

FLoibl opened this issue Apr 29, 2014 · 14 comments
Labels
Status: Stale This issue hasn't had any activity for a while, and will be auto-closed if no further updates occur.

Comments

@FLoibl
Copy link

FLoibl commented Apr 29, 2014

Can someone explain to me the rationale behind calling the doDrilldown method on every point when clicking on the Axis labels?
This causes the "drilldown" Event in the Chart to fire multiple times,
which is kind of bad when drilling down asynchronously.

tickLabel
                    .addClass('highcharts-drilldown-axis-label')
                    .css(chart.options.drilldown.activeAxisLabelStyle)
                    .on('click', function () {
                        each(tickLabel.ddPoints, function (point) {
                            if (point.doDrilldown) {
                                point.doDrilldown(true);
                            }
                        });
                        chart.applyDrilldown();
                    });
@gvaartjes gvaartjes assigned gvaartjes and unassigned gvaartjes May 7, 2014
@pawelfus
Copy link
Contributor

pawelfus commented Aug 4, 2014

Duplicate: #2922 ?

@mestremuten
Copy link

For sure this is not the best solution, but it's a patch that worked for me while I'm waiting for a official fix.

From v4.0.3 to v4.0.4, it was fixed that it didn't render duplicated series in the drilldown chart, but the event is still being fired N times where N is the number of series on the main chart that share the same xAxis point.

I've just added a "check for unique drilldown IDs", at the tick label click event.

-> drilldown.src.js line 542~554 (Highcharts-4.0.4)

tickLabel
    .addClass('highcharts-drilldown-axis-label')
    .css(chart.options.drilldown.activeAxisLabelStyle)
    .on('click', function () {
        var uniqueDrilldowns = {};
        each(tickLabel.ddPoints, function (point) {
            if (point.doDrilldown && !uniqueDrilldowns[point.drilldown]) {
                uniqueDrilldowns[point.drilldown] = true;
                point.doDrilldown(true);
            }
        });
        chart.applyDrilldown();
    });

@stefanodcIT
Copy link

The problem continue to be present with every version of drilldown that i could find.
No way to solve the multiple drilldown event fired when we have multiple series in a single drilldown category?

Thanks.

Note: i've forked from pawelfus #2922 example by adding a second serie.
http://jsfiddle.net/cf71y1kh/1/
If you click on the category label you could see that 2 drilldown call are fired.

@pzgz
Copy link

pzgz commented Sep 15, 2016

Yes, getting this issue too, when there are more than one series, and trying to drilldown from label will fire the drilldown event twice, and then it will caused the Uncaught TypeError: Cannot read property 'xAxis' of null error.

@FLoibl
Copy link
Author

FLoibl commented Sep 16, 2016

IIRC i "fixed" it with sth similar to @mestremuten's Patch but this code was just for a prototype which never went into production.

@TorsteinHonsi
Copy link
Collaborator

It is supposed to fire the drilldown event for each point. See http://api.highcharts.com/highcharts/chart.events.drilldown.

Would it help if we added a drilldownall event that fires after all the points have drilled down, analogous to drillupall?

@pzgz
Copy link

pzgz commented Sep 16, 2016

@TorsteinHonsi Sounds promising, looks like we can simply use drilldownall event if we don't care which series was clicked when drilldown from both chart point or category.

@pzgz
Copy link

pzgz commented Sep 16, 2016

For workaround, I used points and point of the drilldown event parameter, only execute the procedure only for two situations:

  • points is false, means click on chart point
  • point is equal to points[0], means click on chart category, by this, the event procedure will only be executed once if click on category

Such as following:

if (!e.points || e.points[0] == e.point) {
    ......
}

@goralpl
Copy link

goralpl commented May 5, 2017

@pzgz @TorsteinHonsi

Has there been an update to the drilldown.js to include a drilldownall event?

@gtoups
Copy link

gtoups commented Apr 17, 2019

For workaround, I used points and point of the drilldown event parameter, only execute the procedure only for two situations:

* `points` is `false`, means click on chart point

* `point` is equal to `points[0]`, means click on chart category, by this, the event procedure will only be executed once if click on category

Such as following:

if (!e.points || e.points[0] == e.point) {
    ......
}

Thanks for the workaround!

@sansmash
Copy link

sansmash commented Apr 30, 2019

For workaround, I used points and point of the drilldown event parameter, only execute the procedure only for two situations:

  • points is false, means click on chart point
  • point is equal to points[0], means click on chart category, by this, the event procedure will only be executed once if click on category

Such as following:

if (!e.points || e.points[0] == e.point) {
    ......
}

Any suggestion on handling the same in drillup? Since point, points not available in drillup event?

@pawelfus
Copy link
Contributor

Hi @sansmash

We have chart.events.drillupall event. We don't have drilldownall

@sansmash
Copy link

Hi @sansmash

We have chart.events.drillupall event. We don't have drilldownall

That worked! Thank you.

@stale
Copy link

stale bot commented Nov 7, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions!

@stale stale bot added the Status: Stale This issue hasn't had any activity for a while, and will be auto-closed if no further updates occur. label Nov 7, 2020
@highsoft-bot highsoft-bot added this to To do in Development-Flow via automation Nov 7, 2020
@stale stale bot closed this as completed Nov 14, 2020
Development-Flow automation moved this from To do to Done Nov 14, 2020
@Izothep Izothep removed this from Done in Development-Flow Jul 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Stale This issue hasn't had any activity for a while, and will be auto-closed if no further updates occur.
Projects
None yet
Development

No branches or pull requests