我正在尝试使用 angularJs 更新 JvectorMap 的系列。问题是修改了颜色系列,但是没有渲染出来……
Plunkr:http ://plnkr.co/edit/ib3Rgz?p=preview
scope.$watch("datamap" , function(n,o){
console.log(chart)
if(!chart){
$(element).width('auto')
$(element).height(400)
chart = $(element).vectorMap({
series: {
regions: [{
values: scope.mapData,
scale: ['#dcdcef','ceadec'],
normalizeFunction: 'polynomial'
}]
}
})
}else{
console.log(chart.vectorMap('get', 'mapObject').series.regions)
chart.vectorMap('get', 'mapObject').series.regions[0].setNormalizeFunction('polynomial')
chart.vectorMap('get', 'mapObject').series.regions[0].setScale(['#CCCCCC','D0D0D0'])
chart.vectorMap('get', 'mapObject').series.regions[0].setValues(scope.datamap)
}
});