Skip to content
Advertisement

How to display values on line stacked columns on highcharts

enter image description here

I want to display the value on the growth in the stacked column but it hasn’t worked yet, can anyone help me? ;(

I set it on the datalabel like it still doesn’t work

 plotOptions: {
    column: {
        stacking: 'normal',
        dataLabels: {
                  enabled: true,
                  formatter: function() {    
                        return this.point.y;
                   },
                  style:{
                        fontSize: 8
                    }
              }
    },
    line: {
        dataLabels: {
            enabled: true,
            allowOverlap: true
        }
    }
}

http://jsfiddle.net/ndhanajh06/r16e2Lyw/2/

Advertisement

Answer

You have used spline series type, so you need to enable data labels for spline, not line:

plotOptions: {
  column: {
    ...
  },
  spline: {
    dataLabels: {
      enabled: true,
      allowOverlap: true
    }
  }
}

Live demo: http://jsfiddle.net/BlackLabel/fputh18a/

API Reference: https://api.highcharts.com/highcharts/plotOptions.spline.dataLabels

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement