Search code examples
amchartsammap

Exclude countries dynamically amCharts


I want to exclude countries from map (amCharts v4 maps) dynamically. But when I push values into polygon series nothing changes. polygonSeries.exclude.push('RU');. I must redraw a map to see new excluded countries. How to exclude countries without reloading the map?. See example in this codepen. Thanks.


Solution

  • The solution is, instead of excluding, using "hide" function polygonSeries.getPolygonById("RU").hide();.