0

我无法绑定我们所有国家的高地图。

我在数据系列中有错误,下面是我的地图配置。

导入文件

import { MapChart } from 'angular-highcharts';
import * as Highcharts from 'highcharts/highmaps';
import * as usJson from 'src/assets/maps/us-all.geo.json';

地图配置

new MapChart({
            chart: {
                map: usJson
            },
            title: {
                text: "Highmaps basic demo"
            },
            subtitle: {
                text:
                    'Source map: <a href="http://code.highcharts.com/mapdata/custom/world.js">World, Miller projection, medium resolution</a>'
            },
            mapNavigation: {
                enabled: true,
                buttonOptions: {
                    alignTo: "spacingBox"
                }
            },
            legend: {
                enabled: true
            },
            colorAxis: {
                min: 0
            },
            series: [
                {
                    type: 'mappoint',
                    mapData: usJson,
                    name: 'Cities',
                    data: [
                        {
                            "value": 438,
                            "code": "nj"
                        },
                        {
                            "value": 387.35,
                            "code": "ri"
                        }
                    ]
                }],

        });
    }

}

highmaps还在应用模块文件中添加了模块。

*这里是全系列数据链接。 https://cdn.jsdelivr.net/gh/highcharts/highcharts@v7.0.0/samples/data/us-population-density.json

4

0 回答 0