score:0

Accepted answer

Found the answer myself. If somebody is interested – this is what I ended up using:

<script>  
d3.csv("simpledata.csv", function(error, csvdata1) {

    globalcsvdata1 = csvdata1;

    for (var i=0;i<csvdata1.length;i++)
        { 
                globalcsvdata1[ globalcsvdata1[i].ISO] = globalcsvdata1[i] ;
                //console.log(globalcsvdata1[i]);
                delete  globalcsvdata1[i].ISO;
                delete  globalcsvdata1[i] ;
            }
myMap.updateChoropleth(globalcsvdata1);

}

);



var myMap = new Datamap({
    element: document.getElementById('map'),
    scope: 'world',
    geographyConfig: {
        popupOnHover: true,
        highlightOnHover: false
    },
    fills: {
        'AA': '#1f77b4',
        'BB': '#9467bd',
        defaultFill: 'grey'
    }


});



     </script>
</body>

The csv has the following structure:

ISO,fillKey
RUS,AA
USA,BB

Here is a working example: http://www.explainingprogress.com/wp-content/uploads/datamaps/uploaded_gdpPerCapita2011_PWTrgdpe/gdpPerCapita2011_PWTrgdpe.html


Related Query

More Query from same tag