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

Js error when mouse over showing tooltip and c3 is destroyed #997

Closed
danelkhen opened this issue Feb 13, 2015 · 3 comments
Closed

Js error when mouse over showing tooltip and c3 is destroyed #997

danelkhen opened this issue Feb 13, 2015 · 3 comments
Labels
C-bug Category: This is a bug resolved maybe

Comments

@danelkhen
Copy link
Contributor

Sometimes I have to completely regenerate c3 graph (when update isn't supported well for some data changes), if the mouse is hovering over the graph during that time I get the following js error:

Uncaught TypeError: Cannot read property 'data_types' of null

The error can be tested using this code (just move the mouse and let the magic happen):

    var _chart;
    var _testIndex = 0;
    function test() {
        _testIndex++;
        console.info("testing "+_testIndex);
        if (_chart != null) {
            _chart.destroy();
            _chart = null;
        }
        var x = {
            data: { columns: [["x"], ["y"]], x: "x", }
        };
        for (var i = 1; i < 300; i++) {
            x.data.columns[0].push(i * 2);
            x.data.columns[1].push(i * 3);
        }
        _chart = c3.generate(x);
        if(_testIndex<20)
            scheduleTest();
    }

    test();
    function scheduleTest() {
        window.setTimeout(test, 1000);
    }

Happens in c3 0.4.9 (latest), and d3 3.5.0 (recommended version as far as I know)

Thanks

@salemdar
Copy link

+1 for this issue. It doesn't effect anything as far as I can see, but it's unpleasant to see errors on the console.

@masayuki0812
Copy link
Member

Thanks for reporting. Yeah, this should be fixed and I think now it's been fixed by the commit above.
I'll release this fix in the next release 0.4.10 shortly. Thanks.

@masayuki0812 masayuki0812 added C-bug Category: This is a bug resolved maybe labels Mar 14, 2015
@masayuki0812
Copy link
Member

0.4.10 has been released, so let me close at the moment. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug resolved maybe
Projects
None yet
Development

No branches or pull requests

3 participants