var test = new Vizz("res", "#03afcc"); var d = []; var f = 0; test.color = "#2196f3"; document.getElementById('vizz').style.background = '#9c27b0'; var f = 0; $.doTimeout('someid', 100, function ( ) { for (var i = 0; i < 10; i++) { d[i] = Math.sin(i / f); f++; } if(f > 100) f = 0; test.mode_2(d, 20, 20); return true; }, true);