Search code examples
highchartsjscript

high charts: in bar labels only showing on some bars


using HighChart bar chart. aiming for big font labels on the bars

have increased font size in the datalabels.style.fontSize = 50

but labels only show in 2 of the right hand columns!

making font smaller (e.g. 30) it only shows in one bar... weird!

http://jsfiddle.net/py6txbr9/57/

            dataLabels: {
                enabled: true,
                style: {
                    fontSize: 30,
                    color: 'white'
                }
            },

welcome any thoughts if this is happened to anyone else - can't find any bugs or issues else where.

thanks


Solution

  • Defaulty databales are printed "above" column, so when you set white color, there are "invisible". The solution is set "inside" flag as true and verticalAlign as top

    dataLabels: {
                        enabled: true,
                        verticalAlign:'top',
                        inside:true,
                        style: {
                            fontSize: 30,
                            color: 'white'
                        }
                    },
    

    Example: http://jsfiddle.net/py6txbr9/59/