You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2021/02/24 10:00:05 UTC

[GitHub] [echarts] zhangqiangzgz opened a new issue #14339: 点击图例报错后图例点击交互无法正常使用

zhangqiangzgz opened a new issue #14339:
URL: https://github.com/apache/echarts/issues/14339


   ### Version
   5.0.2
   
   ### Steps to reproduce
   vue3项目在单独的组件中引入bar,引入方式如下'2',柱形图可以正常渲染出来,但是点击图例控制台会报错,进而导致图片无法再次点击
   1、报错信息:
   BarView.js?67cc:148 Uncaught TypeError: Cannot read property 'getBaseAxis' of undefined
       at BarView._renderNormal (BarView.js?67cc:148)
       at BarView.render (BarView.js?67cc:112)
       at Task.progress (Chart.js?e887:196)
       at Task._doProgress (task.js?9fbc:187)
       at Task.perform (task.js?9fbc:153)
       at eval (echarts.js?1be7:1639)
       at GlobalModel.eval (Global.js?7e63:549)
       at Array.forEach (<anonymous>)
       at each (util.js?6d8b:206)
       at GlobalModel.eachSeries (Global.js?7e63:546)
   
   2、vue组件内引入bar的方式
   // 引入 echarts 核心模块,核心模块提供了 echarts 使用必须要的接口。
   import * as echarts from 'echarts/core'
   // 引入柱状图图表,图表后缀都为 Chart
   import {
     BarChart
   } from 'echarts/charts'
   // 引入提示框,标题,直角坐标系组件,组件后缀都为 Component
   import {
     TitleComponent,
     TooltipComponent,
     LegendComponent,
     GridComponent
   } from 'echarts/components'
   // 引入 Canvas 渲染器,注意引入 CanvasRenderer 或者 SVGRenderer 是必须的一步
   import {
     CanvasRenderer
   } from 'echarts/renderers'
   
   // 注册必须的组件
   echarts.use(
     [
       BarChart,
       TitleComponent,
       TooltipComponent,
       LegendComponent,
       GridComponent,
       CanvasRenderer
     ]
   )
   
   ### What is expected?
   点击图例不报错,图例点击交互可以正常使用
   
   ### What is actually happening?
   点击图例控制台报错后图例点击交互无法正常使用
   
   ---
   柱形的的配置等代码从原来写的一个demo中移植过来的,demo中使用的在echarts官网在线定制的bar库,通过script在html中引入,demo正常使用,无图例点击报错的问题。
   
   <!-- This issue is generated by echarts-issue-helper. DO NOT REMOVE -->
   <!-- This issue is in English. DO NOT REMOVE -->


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] zhangqiangzgz commented on issue #14339: vue3项目点击图例报错后图例点击交互无法正常使用

Posted by GitBox <gi...@apache.org>.
zhangqiangzgz commented on issue #14339:
URL: https://github.com/apache/echarts/issues/14339#issuecomment-787700803


   参考#14342回复,目前这个问题解决了。
   问题原因:vue3项目中echarts.init()创建的实例定义为响应式。经过测试,vue2的写法在data中定义chartInstance或者vue3的写法通过ref定义chartInstance,都会出现该问题。
   问题解决:
   vue3中echarts.init()创建的实例定义为普通非响应式变量,例如let chartInstance = echars.init()
   另外,
   vue3项目中通过reactive定义chartInstance,不会出现该问题。
   vue2项目中可以在data中定义chartInstance,然后this.chartInstance = echarts.init(),不会出现该问题。


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] echarts-bot[bot] commented on issue #14339: vue3项目点击图例报错后图例点击交互无法正常使用

Posted by GitBox <gi...@apache.org>.
echarts-bot[bot] commented on issue #14339:
URL: https://github.com/apache/echarts/issues/14339#issuecomment-785646663


   @zhangqiangzgz Please provide a demo for the issue either with https://codepen.io/Ovilia/pen/dyYWXWM , https://www.makeapie.com/editor.html or https://codesandbox.io/s/mystifying-bash-2uthz.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] echarts-bot[bot] commented on issue #14339: 点击图例报错后图例点击交互无法正常使用

Posted by GitBox <gi...@apache.org>.
echarts-bot[bot] commented on issue #14339:
URL: https://github.com/apache/echarts/issues/14339#issuecomment-784957243






----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] plainheart closed issue #14339: vue3项目点击图例报错后图例点击交互无法正常使用

Posted by GitBox <gi...@apache.org>.
plainheart closed issue #14339:
URL: https://github.com/apache/echarts/issues/14339


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] plainheart commented on issue #14339: vue3项目点击图例报错后图例点击交互无法正常使用

Posted by GitBox <gi...@apache.org>.
plainheart commented on issue #14339:
URL: https://github.com/apache/echarts/issues/14339#issuecomment-791941026


   或者可以使用 shallowRef 既然解决了 这个issue 就关闭了。


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] zhangqiangzgz commented on issue #14339: 点击图例报错后图例点击交互无法正常使用

Posted by GitBox <gi...@apache.org>.
zhangqiangzgz commented on issue #14339:
URL: https://github.com/apache/echarts/issues/14339#issuecomment-785553323


   vue3项目中通过全部/按需两种方式引入echarts,使用官方的配置数据https://echarts.apache.org/examples/zh/editor.html?c=bar-y-category渲染柱形图,点击图例时会出现相同的报错。


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org