aantthony / graph.tk

Javascript Graphing Utility using HTML 5 Canvas
http://aantthony.github.com/graph.tk/
391 stars 51 forks source link

app.empty() not removing all plots [Firefox for Mac 16.0.1] #52

Open AstDerek opened 12 years ago

AstDerek commented 12 years ago

Seems this loop has some problems to remove all the graphs:

for(var i=0;i<graphs.length;i++){
    app.ui.colors.free.push(graphs[i].color);
    graphs.splice(i,1);
}

This change works fine:

for (n in graphs){
    app.ui.colors.free.push(graphs[n].color);
}

graphs = {};

P.S.: change above fails, this one seems good though

for(n=0;n<graphs.length;n++){
    app.ui.colors.free.push(graphs[n].color);
}
graphs = [];