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

An error is thrown in the Scheduler #11395

Closed
pissang opened this issue Oct 14, 2019 · 2 comments · Fixed by #14934
Closed

An error is thrown in the Scheduler #11395

pissang opened this issue Oct 14, 2019 · 2 comments · Fixed by #14934
Assignees
Labels
bug en This issue is in English priority: high
Milestone

Comments

@pissang
Copy link
Contributor

pissang commented Oct 14, 2019

Version

4.3.0

Steps to reproduce

  • Call setOption with legend unselected in option
  • Call setOption with delay
  • Call resize

Full test code:

<html>
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1" />
        <script src="lib/esl.js"></script>
        <script src="lib/config.js"></script>
        <script src="lib/jquery.min.js"></script>
        <script src="lib/facePrint.js"></script>
        <script src="lib/testHelper.js"></script>
        <link rel="stylesheet" href="lib/reset.css" />
    </head>
    <body>
        <style>
        </style>

        <div id="main0"></div>

        <script>
        require(['echarts'/*, 'map/js/china' */], function (echarts) {
            var option;

            option = {
                legend: [{
                    data: ['dataset 1', 'dataset 2'],
                    selected: {
                        'dataset 2': false,
                        'dataset 1': true
                    }
                }],
                xAxis: {
                    data: ['Beijing', 'Guangzhou', 'Shenzhen']
                },
                yAxis: {},
                series: [{
                    name: 'dataset 1',
                    type: 'bar',
                    data: [10, 20, 15]
                }, {
                    name: 'dataset 2',
                    type: 'bar',
                    data: [10, 20, 15]
                }]
            };

            var chart = testHelper.create(echarts, 'main0', {
                title: [
                    'Delay setOption',
                    'It should not throw error when doing following steps',
                    '(1) setOption with legend unselected in option',
                    '(2) setOption with delay',
                    '(3) resize()'
                ],
                option: option
            });

            chart.setOption({}, false, true);
            chart.resize();
        });
        </script>

    </body>
</html>

What is expected?

Chart is displayed properly

What is actually happening?

Throw an error

MacHi 2019-10-14 19-58-13

@pissang pissang changed the title An error thrown in the Scheduler An error is thrown in the Scheduler Oct 14, 2019
@100pah 100pah added this to the 4.5.0 milestone Oct 14, 2019
@100pah 100pah added the bug label Oct 14, 2019
@Ovilia Ovilia added the en This issue is in English label Oct 14, 2019
@easonyq
Copy link

easonyq commented Oct 15, 2019

As a workaround, the following change works! (Thanks to @pissang )

- chart.setOption({}, false, true);
+ chart.setOption({}, false, false);

@pissang pissang modified the milestones: 4.5.0, 4.6.0 Oct 30, 2019
@pissang pissang modified the milestones: 4.6.0, TBD Dec 2, 2019
@pissang pissang modified the milestones: TBD, 5.1.1 Mar 30, 2021
@echarts-bot
Copy link

echarts-bot bot commented Mar 31, 2021

This issue is labeled with priority: high, which means it's a frequently asked problem and we will fix it ASAP.

@pissang pissang modified the milestones: 5.1.1, 5.1.2 Apr 22, 2021
100pah added a commit that referenced this issue May 13, 2021
100pah added a commit that referenced this issue May 13, 2021
fix: error thrown when resize is called after setOption called with lazyUpdate: true. fix #14846, fix #11395 .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug en This issue is in English priority: high
Projects
None yet
4 participants