Вы можете использовать те же позиции текста, чтобы расположить прямоугольники:
chart.renderer.rect(point.plotX + chart.plotLeft + 5, point.plotY + chart.plotTop - 25, box.width + 10, box.height + 10, 5)
Highcharts.chart('container', {
chart: {
type: 'column'
},
xAxis: {
categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
},
yAxis: {
max: 300
},
series: [{
data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]
}]
}, function (chart) {
for(var i = 0; i <= 10; i++) {
var point = chart.series[0].data[i];
let text = chart.renderer.text(
'Hien' + i,
point.plotX + chart.plotLeft + 10,
point.plotY + chart.plotTop - 10
).attr({
zIndex: 5
}).add();
let box = text.getBBox();
chart.renderer.rect(point.plotX + chart.plotLeft + 5, point.plotY + chart.plotTop - 25, box.width + 10, box.height + 10, 5)
.attr({
fill: '#FFFFEF',
stroke: 'gray',
'stroke-width': 1,
zIndex: 4
})
.add();
}
});
<script src="https://code.highcharts.com/highcharts.js"></script>
<div id="container" style="height: 300px; width: 400"></div>