Я пытаюсь зафиксировать событие детализации на диаграмме Sunburst, но не могу его достичь.
Я добавил объект событий на объект диаграммы и все еще не смог получить предупреждение в пределахfunction.
В основном я хочу, чтобы alert / console.log запускался, когда мы выполняем детализацию, нажимая кнопку в правом верхнем углу после детализации уровня / уровней.
A codepen здесь для вашей справки.
Highcharts.chart('container', {
chart: {
height: '100%',
events: {
drillup: function() {
alert('Drilling up')
}
}
},
title: {
text: 'World population 2017'
},
subtitle: {
text: 'Source <href="https://en.wikipedia.org/wiki/List_of_countries_by_population_(United_Nations)">Wikipedia</a>'
},
series: [{
type: "sunburst",
data: data,
allowDrillToNode: true,
cursor: 'pointer',
dataLabels: {
format: '{point.name}',
filter: {
property: 'innerArcLength',
operator: '>',
value: 16
}
},
levels: [{
level: 1,
levelIsConstant: false,
dataLabels: {
filter: {
property: 'outerArcLength',
operator: '>',
value: 64
}
}
}, {
level: 2,
colorByPoint: true
},
{
level: 3,
colorVariation: {
key: 'brightness',
to: -0.5
}
}, {
level: 4,
colorVariation: {
key: 'brightness',
to: 0.5
}
}]
}],
tooltip: {
headerFormat: "",
pointFormat: 'The population of <b>{point.name}</b> is <b>{point.value}</b>'
}
});
Пожалуйста, совет.