Amchart:更改MapChart错误的颜色

问题描述 投票:0回答:1

我有一个世界地图,没有颜色(默认情况下,国家/地区为灰色,海洋为白色):

enter image description here

我的代码:

var container = am4core.create("concatChart", am4core.Container);
container.width = am4core.percent(100);
container.height = am4core.percent(100);

this.mapChart = container.createChild(am4maps.MapChart);
this.mapChart.geodata = am4geodata_continentsHigh;
this.mapChart.projection = new am4maps.projections.Miller();

var polygonSeries = this.mapChart.series.push(new am4maps.MapPolygonSeries());
polygonSeries.useGeodata = true;

我通过将这些行添加到我的代码中来添加了一些颜色:

this.mapChart.backgroundSeries.mapPolygons.template.polygon.fill = am4core.color("#91c2dc");
this.mapChart.backgroundSeries.mapPolygons.template.polygon.fillOpacity = 1;

polygonSeries.mapPolygons.template.fill = am4core.color("#FFFFFF");
polygonSeries.mapPolygons.template.strokeOpacity = 0;

但是实际上是错误的,好像世界地图被切掉了:

enter image description here

dictionary colors amcharts
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.