Highcharts Motion Map Colors Australia

author(s): Lars Cabrera

by J. Albert Bowden

HTML

<script src="http://code.highcharts.com/maps/highmaps.js"></script>
<script src="http://code.highcharts.com/maps/modules/exporting.js"></script>
<script src="http://code.highcharts.com/mapdata/countries/au/au-all.js"></script>
<script src="https://rawgit.com/larsac07/Motion-Highcharts-Plugin/master/motion.js"></script>

<div id="container"></div>

CSS

@import "http://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css";
#container {
    height: 400px;
    min-width: 310px;
    max-width: 800px;
    margin: 0 auto;
}
.loading {
    margin-top: 10em;
    text-align: center;
    color: gray;
}
#play-controls {
    text-align: center;
    width: 100%;
    padding: 5px 0 1em 0;
}
#play-controls * {
    display: inline-block;
    vertical-align: middle;
}
#play-pause-button {
    width: 30px;
    height: 30px;
    text-align: center;
    font-size: 15px;
    outline: none;
    cursor: pointer;
}
#play-range {
    margin: 2.5%;
    width: 70%;
}
#play-output {
    font-family:"Lucida Grande", "Lucida Sans Unicode", Arial, Helvetica, sans-serif;
}

JavaScript

var data = [
    {
        "hc-a2": "NT",
        "sequence": [100, 200, 300, 400, 500, 600, 700, 800, 900, 1000, 1100],
        "value": 1100
    }, {
        "hc-a2": "WA",
        "sequence": [100, 200, 300, 400, 500, 600, 700, 800, 900, 1000, 1100],
        "value": 1100
    }, {
        "hc-a2": "CT",
        "sequence": [100, 200, 300, 400, 500, 600, 700, 800, 900, 1000, 1100],
        "value": 1100
    }, {
        "hc-a2": "SA",
        "sequence": [100, 200, 300, 400, 500, 600, 700, 800, 900, 1000, 1100],
        "value": 1100
    }, {
        "hc-a2": "QL",
        "sequence": [100, 200, 300, 400, 500, 600, 700, 800, 900, 1000, 1100],
        "value": 1100
    }, {
        "hc-a2": "NI",
        "sequence": [100, 200, 300, 400, 500, 600, 700, 800, 900, 1000, 1100],
        "value": 1100
    }, {
        "hc-a2": "TS",
        "sequence": [100, 200, 300, 400, 500, 600, 700, 800, 900, 1000, 1100],
        "value": 1100
    }, {
        "hc-a2": "JB",
        "sequence": [100, 200, 300, 400, 500, 600, 700, 800, 900, 1000, 1100],
        "value": 1100
    }, {
        "hc-a2": "NS",
        "sequence": [100, 200, 300, 400, 500, 600, 700, 800, 900, 1000, 1100],
        "value": 1100
    }, {
        "hc-a2": "VI",
        "sequence": [100, 200, 300, 400, 500, 600, 700, 800, 900, 1000, 1100],
        "value": 1100
    }
];

// Initiate the chart
Highcharts.mapChart('container', {
    title: {
        text: 'Highmaps motion'
    },

    subtitle: {
        text: 'Source map: <a href="http://code.highcharts.com/mapdata/countries/au/au-all.js">Australia</a>'
    },

    mapNavigation: {
        enabled: true,
        buttonOptions: {
            verticalAlign: 'bottom'
        }
    },

    colorAxis: {
        min: 0,
        max: 1100
    },

    motion: {
        enabled: true,
        axisLabel: 'year',
        labels: [2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010],
        series: 0, // The series which holds points to update
       ...