score:1

Accepted answer

You need to use nodeFormatter function and calculate percentage value:

dataLabels: {
  nodeFormatter: function() {
    const point = this.point;
    const percentage = point.linksTo[0] ?
      point.sum / point.linksTo[0].fromNode.sum * 100 :
      100;

    return point.name + ' >> ' + point.sum + ' (' + Math.round(percentage) + ')%'
  }
}

Live demo: https://jsfiddle.net/BlackLabel/q845s7on/

API Reference: https://api.highcharts.com/highcharts/series.sankey.dataLabels.nodeFormatter


Related Articles