8000 Js error when mouse over showing tooltip and c3 is destroyed · Issue #997 · c3js/c3 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Js error when mouse over showing tooltip and c3 is destroyed #997
Closed
@danelkhen

Description

@danelkhen

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0