I want to create a custom tooltip in Apex Charts. Below is what is suggested in the official docs:
tooltip: {
custom: function({series, seriesIndex, dataPointIndex, w}) {
return '<div class="arrow_box">' +
'<span>' + series[seriesIndex][dataPointIndex] + '</span>' +
'</div>'
}
}
The tooltip above will display the value only. However, I also need information about the corresponding category name (and if possible chart color):
https://codepen.io/apexcharts/pen/xYqyYm
I bet this info is somwhere in w.globals
but I failed to find it there (expesially given it's a recursive object which returns [Object Object]
when you try to copy it from the console).