Seems like drilldown event is not triggered in Highcharts Treemap. I need to perform some task like showing alert with current level number on drilldown and drillup events. How can this be done in Treemaps?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
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/