Question

I tried to create a regional map of UK regions, and hoped to use Google charts which I've used reliably before. Unfortunately, as described in this question, Google charts only covers U.S. states and no other regional data. Is there a different way to create such a map?

Était-ce utile?

La solution

You can have UK regions map made with amMap:

HTML:

<script src="http://www.ammap.com/lib/3/ammap.js" type="text/javascript"></script>
<script src="http://www.ammap.com/lib/3/maps/js/unitedKingdomLow.js" type="text/javascript"></script>
<div id="mapdiv" style="width: 100%; height: 370px;"></div>

JavaScript:

var map;

AmCharts.ready(function() {
    map = new AmCharts.AmMap();
    map.pathToImages = "http://www.ammap.com/lib/3/images/";
    map.panEventsEnabled = true; 
    map.balloon.color = "#000000";

    var dataProvider = {
        mapVar: AmCharts.maps.unitedKingdomLow,
        getAreasFromMap: true
    };

    map.dataProvider = dataProvider;

    map.areasSettings = {
        autoZoom: true,
        selectedColor: "#CC0000",
        outlineThickness:2
    };

    map.smallMap = new AmCharts.SmallMap();

    map.write("mapdiv");

});

Disclaimer: I am the author of amMap tool. Fiddle: http://jsfiddle.net/amcharts/PN2m8/

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top