Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

axisTrigger.js:55 Uncaught TypeError: Cannot read property 'axesInfo' of null #6121

Closed
zhaozhiming opened this issue Jul 4, 2017 · 13 comments
Labels

Comments

@zhaozhiming
Copy link

zhaozhiming commented Jul 4, 2017

One-line summary [问题简述]

页面在加载柱状图的时候 ,鼠标滚动时console 偶尔会出现这个错误,错误的具体信息如下:

axisTrigger.js:55 Uncaught TypeError: Cannot read property 'axesInfo' of null
    at r (axisTrigger.js:55)
    at Object.action (axisPointer.js:47)
    at o.<anonymous> (echarts.js:996)
    at Array.forEach (<anonymous>)
    at f (util.js:263)
    at o.l (echarts.js:994)
    at o.q.dispatchAction (echarts.js:947)
    at r.dispatchAction (util.js:380)
    at n (globalListener.js:99)
    at Object.handler (AxisPointerView.js:24)

Version & Environment [版本及环境]

  • ECharts version [ECharts 版本]: 3.6.1
  • Browser version [浏览器类型和版本]: Chrome v59.0 +
  • OS Version [操作系统类型和版本]: OS X EI Capitan 10.11.6

Expected behaviour [期望结果]

console 不报错

ECharts option [ECharts配置项]

option = {
  color: ['#3398DB'],
  title: {
    text: '地区',
    top: 'top',
    left: 'left',
    textStyle: {
      color: '#000000',
      fontSize: 18,
    },
  },
  tooltip: {
    trigger: 'axis',
    axisPointer: {
      type: 'shadow',
    },
  },
  grid: {
    left: 0,
    right: '4%',
    bottom: '3%',
    containLabel: true,
  },
  xAxis: [
    {
      type: 'category',
      data: ['foo', 'bar'],
      axisTick: {
        alignWithLabel: true,
      },
      axisLabel: {
        interval: 0,
        textStyle: {
          fontSize: 10,
        },
      },
    },
  ],
  yAxis: { show: false },
  series: [
    {
      type: 'bar',
      barWidth: '30%',
      label: {
        normal: {
          show: true,
          position: 'top',
        },
      },
      data: [100, 200],
    },
  ],
}

Other comments [其他信息]

@pissang
Copy link
Contributor

pissang commented Jul 5, 2017

鼠标滚动指的是什么?能否再详细点描述复现方式

@zhaozhiming
Copy link
Author

zhaozhiming commented Jul 5, 2017

@pissang 就是鼠标在屏幕上面移动

@zhaozhiming
Copy link
Author

zhaozhiming commented Jul 5, 2017

不是能很好复现,在我自己的项目里面出现的很频繁,但是把图形抽取出来放到一个独立的环境后就很难看到

@pissang
Copy link
Contributor

pissang commented Jul 5, 2017

其它浏览器有没有这个问题?

@zhaozhiming
Copy link
Author

zhaozhiming commented Jul 5, 2017

FireFox也出现这个错误

@sleagon
Copy link

sleagon commented Jul 11, 2017

我这边也出现这个问题了,出现的场景是:自动收缩左侧导航,页面的echarts表格会跟着变,如果鼠标快速从左侧导航移动到echarts的canvas上,会报这个错。(就是在页面还在变化的过程中鼠标移动到了echarts上。

@pissang pissang added the pending We are not sure about whether this is a bug/new feature. label Jul 11, 2017
@pissang
Copy link
Contributor

pissang commented Jul 11, 2017

@sleagon 谢谢反馈

@sleagon
Copy link

sleagon commented Jul 11, 2017

补充一下,主要是用到了鼠标的移动和点击那几个事件,刚发现所有事件都有问题,只要快速移动过去下一次操作都会报哪个错误。chrome ff 都一样。顺便问一下,这玩意涉及到的东西多吗,好解决吗?没有找到替代方案啊。。。。

@pissang pissang added bug and removed pending We are not sure about whether this is a bug/new feature. labels Jul 11, 2017
@100pah 100pah closed this as completed in 1b52088 Jul 15, 2017
@zhaozhiming
Copy link
Author

zhaozhiming commented Jul 17, 2017

@100pah 请问这个问题为什么关闭?有解决方案了吗?

@reallyimeric
Copy link

reallyimeric commented Jul 17, 2017

@sleagon 请问你是用的 echarts 还是 echarts-for-react 呢,我和 zhaozhiming 都是在 echarts-for-react 遇到的这个问题

@sleagon
Copy link

sleagon commented Jul 17, 2017

echarts-for-react 这个错误看起来就是echarts本身没有做安全检查导致的。不过这个到底是哪里的问题我也不确定了,我之前是直接在content里用的echarts组件,后面我主动封装了一层,现在不报错了。

@zhaozhiming
Copy link
Author

zhaozhiming commented Jul 17, 2017

@100pah 我看到你提的commit了,给力 👍

@TongDaDa
Copy link

TongDaDa commented Aug 15, 2017

我使用echarts-for-react 遇到了这个问题,但是看似程序还可以正常运行。但是错误不会频繁没有规律的出现

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants