echart报错: Component series.map3D not exists. Load it first和Cannot read property 'features' of null

本文解决了一个关于ECharts 3D地图显示的问题,详细介绍了如何通过安装echarts-gl并正确引入world.js来解决Componentseries.map3Dnotexists和Cannotreadproperty‘features’ofnull的错误。

这个问题让我崩溃了一会儿,在百度上查的问题几乎和这个没有关系,最后还是解决了

1.Component series.map3D not exists. Load it first

这个问题我出错的原因是没有安装echarts-gl
npm install echarts-gl
然后在main.js中引入
import echartsGL from ‘echarts-gl’ // 引入echarts
Vue.prototype.$echartsGL = echartsGL // 引入组件(将echarts注册为全局)

然后报错就没有了,接下来是

Cannot read property ‘features’ of null

原因是没有引入world.js
import world from ‘echarts/map/js/world.js’
引入之后就出来了

在这里插入图片描述效果图

评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值