How to get current level on drilldown event in Highcharts treemap?

别来无恙 提交于 2019-12-02 08:39:31

At I see at this moment you can catch redraw event and prepare a simple "parser" which check id. Default structure of that is id_1 for first level, id_1_1 for second level. The simplest is use a split, and check length of array. Obviosuly this is very poor solution.

events: {
            redraw: function () {

                var rootNode = this.series[0].rootNode;

                if (rootNode === '') {
                    alert(' NO DRILLED - LEVEL 0 ')
                } else {
                    if (rootNode.split('_').length == 2) {
                        alert(' DRILLED - LEVEL 1');
                    } else if (rootNode.split('_').length >= 2) {
                        alert(' DRILLED - LEVEL 2');
                    }
                }

            }
        }

Example: http://jsfiddle.net/ghh1x7vt/1/

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!