Hi,
I created a custom tooltip and custom chart labels. An example can be found here:
https://codesandbox.io/p/sandbox/highch ... 35c14a291a
How can I make the label stay behind the tooltip background?
Code: Select all
tooltip: {
...,
positioner: function (labelWidth, labelHeight, point) {
let x = point.plotX + this.chart.plotLeft - labelWidth / 2;
let y = point.plotY + this.chart.plotTop - labelHeight - 10;
const chartWidth = this.chart.plotWidth;
const chartHeight = this.chart.plotHeight;
if (x < this.chart.plotLeft) {
x = this.chart.plotLeft;
} else if (x + labelWidth > this.chart.plotLeft + chartWidth) {
x = this.chart.plotLeft + chartWidth - labelWidth;
}
if (y < this.chart.plotTop) {
y = point.plotY + this.chart.plotTop + 10;
}
return { x, y };
},
}