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