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 2019/12/06 03:31:46 UTC

[GitHub] [incubator-echarts] duanmw opened a new issue #11800: 雷达图使用“ dispatch showTip”时报错,无法showTip

duanmw opened a new issue #11800: 雷达图使用“ dispatch  showTip”时报错,无法showTip
URL: https://github.com/apache/incubator-echarts/issues/11800
 
 
   ### Version
   4.4.0-rc.1
   
   ### Steps to reproduce
   使用官方雷达图示例https://www.echartsjs.com/examples/zh/editor.html?c=radar
   添加定时器让其自动showTip(自动轮播显示提示框),运行到showTip就会报错,主要代码如下:
   ```
   <body>
           <div id="main" style="width: 600px;height:400px;"></div>
           <script type="text/javascript">
               // 基于准备好的dom,初始化echarts实例
               var myChart = echarts.init(document.getElementById('main'));
               var option = {
                   title: {
                       text: '基础雷达图'
                   },
                   tooltip: {},
                   legend: {
                       data: ['预算分配(Allocated Budget)', '实际开销(Actual Spending)']
                   },
                   radar: {
                       // shape: 'circle',
                       name: {
                           textStyle: {
                               color: '#fff',
                               backgroundColor: '#999',
                               borderRadius: 3,
                               padding: [3, 5]
                           }
                       },
                       indicator: [
                           { name: '销售(sales)', max: 6500 },
                           { name: '管理(Administration)', max: 16000 },
                           { name: '信息技术(Information Techology)', max: 30000 },
                           { name: '客服(Customer Support)', max: 38000 },
                           { name: '研发(Development)', max: 52000 },
                           { name: '市场(Marketing)', max: 25000 }
                       ]
                   },
                   series: [{
                       name: '预算 vs 开销(Budget vs spending)',
                       type: 'radar',
                       // areaStyle: {normal: {}},
                       data: [{
                               value: [4300, 10000, 28000, 35000, 50000, 19000],
                               name: '预算分配(Allocated Budget)'
                           },
                           {
                               value: [5000, 14000, 28000, 31000, 42000, 21000],
                               name: '实际开销(Actual Spending)'
                           }
                       ]
                   }]
               };
               // 使用刚指定的配置项和数据显示图表。
               myChart.setOption(option);
   
               var theIndex = 1;
               timer && clearInterval(timer);
               var timer = setInterval(function() {
                   if (theIndex < 0) {
                       theIndex = 1;
                   }
                   myChart.dispatchAction({
                       type: 'showTip',
                       seriesIndex: 0,
                       dataIndex: theIndex
                   });
                   theIndex--;
               }, 2000);
           </script>
       </body>
   
   ```
   ### What is expected?
   雷达图按定时器设置而自动showTip(显示提示框)
   
   ### What is actually happening?
   雷达图没有自动显示提示框,且浏览器控制台报错:
   Uncaught TypeError: Cannot read property 'dataToCoord' of undefined
       at Radar.dataToPoint (Radar.js:64)
       at findPointFromSeries (findPointFromSeries.js:32)
       at ExtendedClass.manuallyShowTip (TooltipView.js:188)
       at callView (echarts.js:875)
       at ECharts.<anonymous> (echarts.js:869)
       at Array.forEach (<anonymous>)
       at each$1 (util.js:284)
       at ExtendedClass.eachComponent (Global.js:447)
       at updateDirectly (echarts.js:868)
       at ECharts.<anonymous> (echarts.js:1052)
   ![image](https://user-images.githubusercontent.com/31787613/70293636-d54d0680-181b-11ea-8c66-b20c781f7c48.png)
   

----------------------------------------------------------------
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


With regards,
Apache Git Services

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