question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

coordSys.getOtherAxis is not a function

See original GitHub issue

问题简述 (One-line summary)

import echarts from 'echarts';
import "echarts/lib/chart/map.js";
import "echarts/map/js/china.js";
let map = echarts.init(document.getElementById('map'), 'macarons');
map.setOption({
  tooltip : {
    show: false
  },
  series : [
    {
      name: '中国地图',
      type: 'map',
      mapType: 'china',
      hoverable :false,
      itemStyle:{
        normal:{label:{show:false},areaStyle:{color:'#ffffff'},borderWidth:1,borderColor:'#a8c1cc'},
        emphasis:{label:{show:false}, color:'#4ddd36'}
      },
      data:[
        {name:'河南',selected:true},
        {name:'湖南',selected:true},
        {name:'浙江',selected:true}
      ],
      markPoint : {
        itemStyle : {
          normal:{
            color:'skyblue'
          }
        },
        data : [
          {name : '天津', symbol: 'image://../assets/images/dian.png'},
          {name : '上海', symbol: 'image://../assets/images/dian.png'}
        ]
      },
      geoCoord: {
        '上海': [121.4648,31.2891],
        '天津': [117.4219,39.4189]
      }
    }
  ]
});

显示map会报错 提示,markerHelper.js?fe54:146 Uncaught TypeError: coordSys.getOtherAxis is not a function 把markPoint的配置去掉地图会显示正常。

版本及环境 (Version & Environment)

  • ECharts 版本 (ECharts version): 3.2.2
  • 浏览器类型和版本 (Browser version): chrome
  • 操作系统类型和版本 (OS Version): osx

重现步骤 (Steps to reproduce)

期望结果 (Expected behaviour)

可能哪里有问题 (What went wrong)

查看了源码,geo缺少一个getOtherAxis方法。

ECharts配置项 (ECharts option)

option = {

}

其他信息 (Other comments)

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
pissangcommented, Jul 29, 2016

在 3 里地图上的markPoint 的 data 需要提供一个 coord 作为位置

4reactions
sbmingcommented, Jan 6, 2019

for example markPoint: { data: [{ name: ‘上海’, coord: [121.4648, 31.2891] }] }

Read more comments on GitHub >

github_iconTop Results From Across the Web

coordSys.getOtherAxis is not a function · Issue #3741 - GitHub
import echarts from 'echarts'; import "echarts/lib/chart/map.js"; import "echarts/map/js/china.js"; let map = echarts.init(document.
Read more >
echarts使用markLine报错'coordSys.getOtherAxis is not ... - 简书
今天在项目中参考echarts.Example,选用“地图”里面的“中国铁路运输干线”效果: 好了下面说说为什么要引入echarts-2.2.7/echarts-all.js...
Read more >
echarts3 中使用markpoint 报错- OSCHINA - 中文开源技术交流 ...
NGINX Sprint China 2022--NGINX 年度旗舰盛会,已开启免费预约!>>> 报 coordSys.getOtherAxis is not a function 错误. markPoint :{
Read more >
echarts使用markline报错'coordSys.getOtherAxis is not a ...
码农颜小白的博客 继上一个一个文章发现项目成功运行了之后,但是将echarts实例拿过来后,又遇到了报错getLabelsCoords is not a function。
Read more >
echarts - UNPKG
1, declare type VectorArray = number[];. 2, declare function create(x?: number, y?: number): VectorArray;. 3, declare function copy<T extends ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found