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

雷达图使用“ dispatch showTip”时报错,无法showTip #11801

Closed
duanmw opened this issue Dec 6, 2019 · 1 comment
Closed

雷达图使用“ dispatch showTip”时报错,无法showTip #11801

duanmw opened this issue Dec 6, 2019 · 1 comment
Assignees
Labels

Comments

@duanmw
Copy link

duanmw commented Dec 6, 2019

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. (echarts.js:869)
at Array.forEach ()
at each$1 (util.js:284)
at ExtendedClass.eachComponent (Global.js:447)
at updateDirectly (echarts.js:868)
at ECharts. (echarts.js:1052)
image

@echarts-bot
Copy link

echarts-bot bot commented Dec 6, 2019

Hi! We've received your issue and please be patient to get responded. 🎉
The average response time is expected to be within one day for weekdays.

In the meanwhile, please make sure that you have posted enough image to demo your request. You may also check out the API and chart option to get the answer.

If you don't get helped for a long time (over a week) or have an urgent question to ask, you may also send an email to dev@echarts.apache.org. Please attach the issue link if it's a technical questions.

If you are interested in the project, you may also subscribe our mail list.

Have a nice day! 🍵

@echarts-bot echarts-bot bot added bug pending We are not sure about whether this is a bug/new feature. waiting-for: community labels Dec 6, 2019
@yufeng04 yufeng04 removed pending We are not sure about whether this is a bug/new feature. waiting-for: community labels Dec 8, 2019
@yufeng04 yufeng04 self-assigned this Dec 8, 2019
pissang added a commit that referenced this issue Jan 7, 2020
fix bug #11801 Throw error when the action 'showTip' dispatched in radar chart
@duanmw duanmw closed this as completed Jun 9, 2020
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

2 participants