DataLabelBackGround IE

by Torstein Hønsi

HTML

<div id="container" style=" height:400px; border: 1px solid black;"></div>

<script src="http://code.highcharts.com/highcharts.js"></script>

JavaScript

var ren = new Highcharts.Renderer(
    document.getElementById("container"),
    400, 
    400
);

var y = 0;
[6, 7, 8, 9, 10, 11, 12, 13, 14, 16, 18, 20, 22, 24].forEach(function (px, i) {
    var label = ren.label('X', 100, 0) 
        .attr({
            fill: "blue",
            padding: 1
        })
        .css({
        	//fontFamily: 'verdana',
            fontSize: px + 'px',
            color: 'white'
        })
        .add();

	var height = label.text.element.getBBox().height;
    y += height + 3;
    
    label.attr({
    	text: px + 'px => ' + height,
        y: y
    });
    
   	

});