score:1

Accepted answer

you can correct data-labels positions by using the attr method on their svg elements.

for example:

  chart: {
    events: {
      render: function() {
        const series = this.series;
        const dl1 = series[3].points[0].datalabel;
        const dl2 = series[4].points[0].datalabel;

        if (dl1.y + dl1.height > dl2.y) {
          dl2.attr({
            y: dl1.y + dl1.height
          });
        }
      }
    }
  }

live demo: https://jsfiddle.net/blacklabel/5lmh4owb/

api reference:

https://api.highcharts.com/class-reference/highcharts.svgelement.html#attr

https://api.highcharts.com/highcharts/chart.events.render


Related Query

More Query from same tag