score:5

Accepted answer

you can change highcharts.series.prototype.drawdatalabels, the function to draw the datalabels:

highcharts.series.prototype.drawdatalabels = (function (func) {
    return function () {
        func.apply(this, arguments);
        if (this.options.datalabels.enabled || this._haspointlabels) realignlabels(this);
    };
}(highcharts.series.prototype.drawdatalabels));

realignlabels would be the function to check for the shorter columns, and in it change the rotation, x and y of that specific datalabel:

function realignlabels(serie) {

    $.each(serie.points, function (j, point) {
        if (!point.datalabel) return true;

        var max = serie.yaxis.max,
            labely = point.datalabel.attr('y'),
            labelx = point.datalabel.attr('x');

            if (point.y / max < 0.05) {
                point.datalabel.attr({
                    y: labely - 20,
                    x: labelx + 5,
                    rotation: 0
                });
            }
    });
};

http://jsfiddle.net/yrygy/270/


Related Query

More Query from same tag