AmCharts 4 删除 MapChart 中的大陆(是)
AmCharts4 Remove Continent(s) in a MapChart
我正在使用 @amcharts/amcharts4-geodata/worldLow"
创建一个简单的地图,但不需要南极洲。有没有办法隐藏或删除它,但地图利用南极洲留下的 space 使地图相应调整并使其他大陆更加突出?
初始化代码:
import * as am4maps from "@amcharts/amcharts4/maps";
import am4geodata_worldLow from "@amcharts/amcharts4-geodata/worldLow";
import am4themes_animated from "@amcharts/amcharts4/themes/animated";
let chart = am4core.create("globediv", am4maps.MapChart);
try {
chart.geodata = am4geodata_worldLow;
} catch (e) {
chart.raiseCriticalError(new Error("Map geodata could not be loaded."));
}
chart.projection = new am4maps.projections.Projection;
chart.panBehavior = "move";
let polygonSeries = chart.series.push(new am4maps.MapPolygonSeries());
polygonSeries.data = myData;
polygonSeries.useGeodata = true;
在记录的多边形系列中使用 exclude
属性 here
polygonSeries.exclude = ["AQ"];
let chart = am4core.create("chartdiv", am4maps.MapChart);
try {
chart.geodata = am4geodata_worldLow;
} catch (e) {
chart.raiseCriticalError(new Error("Map geodata could not be loaded."));
}
chart.projection = new am4maps.projections.Miller();
chart.panBehavior = "move";
let polygonSeries = chart.series.push(new am4maps.MapPolygonSeries());
polygonSeries.useGeodata = true;
polygonSeries.exclude = ["AQ"];
#chartdiv {
width: 100%;
height: 400px;
}
<script src="https://cdn.amcharts.com/lib/4/core.js"></script>
<script src="https://cdn.amcharts.com/lib/4/maps.js"></script>
<script src="https://cdn.amcharts.com/lib/4/geodata/worldLow.js"></script>
<div id="chartdiv"></div>
我正在使用 @amcharts/amcharts4-geodata/worldLow"
创建一个简单的地图,但不需要南极洲。有没有办法隐藏或删除它,但地图利用南极洲留下的 space 使地图相应调整并使其他大陆更加突出?
初始化代码:
import * as am4maps from "@amcharts/amcharts4/maps";
import am4geodata_worldLow from "@amcharts/amcharts4-geodata/worldLow";
import am4themes_animated from "@amcharts/amcharts4/themes/animated";
let chart = am4core.create("globediv", am4maps.MapChart);
try {
chart.geodata = am4geodata_worldLow;
} catch (e) {
chart.raiseCriticalError(new Error("Map geodata could not be loaded."));
}
chart.projection = new am4maps.projections.Projection;
chart.panBehavior = "move";
let polygonSeries = chart.series.push(new am4maps.MapPolygonSeries());
polygonSeries.data = myData;
polygonSeries.useGeodata = true;
在记录的多边形系列中使用 exclude
属性 here
polygonSeries.exclude = ["AQ"];
let chart = am4core.create("chartdiv", am4maps.MapChart);
try {
chart.geodata = am4geodata_worldLow;
} catch (e) {
chart.raiseCriticalError(new Error("Map geodata could not be loaded."));
}
chart.projection = new am4maps.projections.Miller();
chart.panBehavior = "move";
let polygonSeries = chart.series.push(new am4maps.MapPolygonSeries());
polygonSeries.useGeodata = true;
polygonSeries.exclude = ["AQ"];
#chartdiv {
width: 100%;
height: 400px;
}
<script src="https://cdn.amcharts.com/lib/4/core.js"></script>
<script src="https://cdn.amcharts.com/lib/4/maps.js"></script>
<script src="https://cdn.amcharts.com/lib/4/geodata/worldLow.js"></script>
<div id="chartdiv"></div>