I have this exact same issue: Highcharts tooltip background according to line
but the solutions provided here do not work for me because setting backgroundColor to n
You can wrap Tooltip.refresh()
method and change the tooltip's background according to the point's series color.
const H = Highcharts;
H.wrap(H.Tooltip.prototype, 'refresh', function (p, point, mouseEvents) {
p.call(this, point, mouseEvents);
const label = this.label;
if (point && label) {
label.attr({
fill: point.series.color
});
}
});
example: http://jsfiddle.net/t38x6kug/