apache / echarts

Apache ECharts is a powerful, interactive charting and data visualization library for browser
https://echarts.apache.org
Apache License 2.0
60.61k stars 19.62k forks source link

加载自己的json文件报错series.map not exists. Load it first #7252

Closed liuchang567 closed 6 years ago

liuchang567 commented 6 years ago

One-line summary [问题简述]

vue+echarts 加载自己的地图json文件 报错 --Component series.map not exists. Load it first

Version & Environment [版本及环境]

Expected behaviour [期望结果]

可以加载出地图

ECharts option [ECharts配置项]


 let url = '../static/json/mapjson/640000.json';
                _this.myMap = echarts.init(document.getElementById('echartsMap'));
                utils.GET(url).then((json) => {
                    echarts.registerMap('yunnan', json);
                    _this.myMap.setOption({
                        backgroundColor: '#1b1b1b',
                        series: [{
                            type: 'map',
                            map: 'yunnan',
                            data: []
                        }]
                    });
                });

``

### Other comments [其他信息]
<!-- For example: Screenshot or Online demo -->
<!-- [例如,截图或线上实例 (JSFiddle/JSBin/Codepen)] -->
的
pissang commented 6 years ago

需要加载地图组件

superzhy commented 4 years ago

使用this.$echarts.registerMap("china", chinaJson); 注册了map,还是提示这个错误