0👍
✅
The problem is that the onclick
function is defined outside of your customButton
object, and so Highcharts are not able to find event function to call your handler. Just need to move the function into the customButton
, and then it should work well.
Live demo: https://jsfiddle.net/981nbkur/
API Reference: https://api.highcharts.com/highcharts/exporting.buttons.contextButton.onclick
Kind regards!
Source:stackexchange.com