이
var data = {
"countries" : [
{
"name" : "Brazil",
"code" : "BR",
"pGdp" : "6938",
"cGdp" : "1313590",
"pop" : "196342587",
"continent" : "America"
},
{
"name" : "United States",
"code" : "US",
"pGdp" : "45845",
"cGdp" : "13843825",
"pop" : "303824646",
"continent" : "America"
}
]
}
var countryData = [];
jQuery.each(data.countries, function() {
countryData[this.code] = this[.pGdp];
});
JVM의 설정을 시도 ...
series : {
regions : [ {
values : countryData,
scale : [ '#C8EEFF', '#0071A4' ],
normalizeFunction : 'polynomial'
} ]
},
onRegionLabelShow: function(e, el, code) {
//search through data to find the selected country by it's code
var country = $.grep(data.countries, function(obj, index) {
return obj.code == code;
})[0]; //snag the first one
if (country != undefined) {
el.html(el.html() + "<br/><b>Code: </b>" +country.code + "<br/><b>Continent : </b> " + country.continent);
}
}