Highcharts Demo

author(s): Torstein Hønsi

by akaimo

HTML

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

JavaScript

$(function () {
    $('#container').highcharts({
        chart: {
            type: 'area'
        },
        xAxis: {
            categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
        },

        plotOptions: {
            series: {
                stacking: 'normal',
                dataLabels: {
                    enabled: true,
                    verticalAlign: 'top',
                    borderWidth: 1,
                    y:55,
                    inside:true,
                    rotation:-2,
                    shadow: true,
                    style: {
                        fontWeight: 'bold',
                        color: "#FFFFFF",
                        fontSize: "9px"
                    },
                    formatter: function () {
                        // this works in CH - if (this.series.data.indexOf( this.point ) === 25) {
                        if (this.point.index === 4) {
                            return '<b>' + this.series.name + '</b>';
                        }
                    }
                }
            }
        },

        series: [{
            data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]
        }, {
            data: [144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4, 29.9, 71.5, 106.4, 129.2]
        }]
    });
});