ElementStacks

by hfrntt

HTML

<script src="http://highcharts.com/js/testing.js"></script>
<div id="container" style="height: 400px; width: 500px"></div>

JavaScript

var colors = ['red', 'green', 'blue'],
    colorCounter = 0;

var chart = new Highcharts.Chart({
    chart: {
        renderTo: 'container'
    },
    xAxis: {
        categories: ['category 1', 'category 2', 'category 3'],
        labels: {
            formatter: function(){
                var color  = colors[ colorCounter++ % colors.length ];
                return '<span style="color: ' + color + ';">'+this.value+'</span>';
            }
        }
    },
    
    series: [{
        data: [29.9, 71.5, 106.4]
    }]
});