Highcharts Demo

author(s): Torstein Hønsi

HTML

<script src="http://code.highcharts.com/highcharts.js"></script>
<script src="http://code.highcharts.com/modules/data.js"></script>
<script src="http://code.highcharts.com/modules/heatmap.js"></script>
<script src="http://code.highcharts.com/modules/exporting.js"></script>
<script src="http://www.staff.amu.edu.pl/~andrzejz/files/heatmapdata.js"></script>

<div id="container" style="height: 320px; width: 1000px; margin: 0 auto"></div>

JavaScript

$(function () {

    $('#container').highcharts({

        chart: {
            type: 'heatmap',
            marginTop: 40,
            marginBottom: 40,
            zoomType: 'xy'
        },

        credits: {
            enabled: false
        },

        plotOptions: {
            series: {
                events: {
                    click: function (event) {
                        alert('event!');
                    }
                }
            }
        },


        title: {
            text: 'Sample title yo'
        },

        xAxis: {
            categories: xCategories,
            title: null
        },

        yAxis: {
            categories: yCategories,
            title: null
        },

        colorAxis: {
            min: 0,
            max: 5000000,
            minColor: '#FFFFFF',
            maxColor: Highcharts.getOptions().colors[0]
        },

        legend: {
            align: 'right',
            layout: 'vertical',
            margin: 0,
            verticalAlign: 'top',
            y: 25,
            symbolHeight: 320
        },

        tooltip: {
            formatter: function () {
                return '<b>' + this.series.xAxis.categories[this.point.x] + '</b> sold <br><b>' + this.point.value + '</b> items on <br><b>' + this.series.yAxis.categories[this.point.y] + '</b>';
            }
        },

        series: [{
            name: 'Lorem ipsum',
            borderWidth: 1,
            data: data,
            dataLabels: {
                enabled: false,
                color: 'black',
                style: {
                    textShadow: 'none',
                    HcTextStroke: null
                }
            }
        }]

    });

});