ngx-echats中使用map无法显示的问题

在angular6中用了ngx-echats,其中要使用到中国地图,按照常规的方法地图总是显示不出来,在网上找了很多方法,包括在angular.json中加入js文件

"node_modules/echarts/dist/echarts.min.js",

"node_modules/echarts/map/js/china.js"

等都不可行,最终使用了笨办法解决,如下:

ngx-echats中使用map无法显示的问题ngx-echats中使用map无法显示的问题

在node_modules里面找到echarts 文件夹,找到目录下的lib/chart,找到map.js,在里面添加:require("../../map/js/china");

前提是echats有安装等,缺点是只能在本级的node_modules环境下可用,换一台电脑编译好像就不能用了。

如果有更好的方法请小伙伴留言分享!

相关文章:

  • 2021-12-12
  • 2021-10-25
  • 2021-10-21
  • 2021-12-11
  • 2021-10-07
  • 2021-08-11
  • 2021-04-28
  • 2021-08-08
猜你喜欢
  • 2021-11-08
  • 2021-11-03
  • 2021-12-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-15
相关资源
相似解决方案